").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("
").attr("role","tooltip"),s=t("
").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip});
var infowindow=null;
WPR.polygon;
var myPoly;
(function ($, WPR, infowindow){
window.GetModuleConfig=function (moduleName, callback){
$.getJSON(WPR.ajaxurl,
{
controller: "System",
action: "GetModuleSettings",
module_name: moduleName
},
function (data){
if(data!==null){
callback(data);
}else{
var data2={module: moduleName};
callback(data2);
}
jQuery('body select').select2('destroy');
jQuery("body select").select2({width: '100%'});
}
);
}
window.formToObj=function (formId){
/*
$('#' + formId + ' input[type="checkbox"]').each(function(_, value){
$(value).val($(value).parent().hasClass('checked') ? 'true':'no');
$(this).attr('checked', true);
})
*/
var paramObj={};
$.each($('#' + formId).serializeArray(), function (_, kv){
if(kv.value==undefined)
return true;
else if(paramObj.hasOwnProperty(kv.name)){
paramObj[kv.name]=$.makeArray(paramObj[kv.name]);
paramObj[kv.name].push(kv.value);
}else{
paramObj[kv.name]=kv.value;
}});
return paramObj;
}
window.populateSettings=function (data){
WPR[data.module]=WPR[data.module]||{};
WPR[data.module].settings=WPR[data.module].settings||{};
$.each(data.objectContents, function (key, value){
WPR[data.module].settings[key]=value;
});
defaultMapSettings={
zoom: WPR[data.module].settings['zoom'] ? parseInt(WPR[data.module].settings['zoom']):10,
center: {
lat: WPR[data.module].settings['ctr-lat'] ? parseFloat(WPR[data.module].settings['ctr-lat']):28.489997965086314,
lng: WPR[data.module].settings['ctr-lng'] ? parseFloat(WPR[data.module].settings['ctr-lng']):-81.35369869873051
},
mapTypeId: WPR[data.module].settings['map_type'],
disableDefaultUI: true,
maxZoom: WPR[data.module].settings['max-zoom'] ? WPR[data.module].settings['max-zoom']:null
}
var afterSettingsLoaded;
if(navigator.appName=='Microsoft Internet Explorer'||navigator.appName=='Netscape'){
afterSettingsLoaded=document.createEvent('CustomEvent');
afterSettingsLoaded.initCustomEvent("RPxSettingsLoaded", true, true, {message: 'done'});
}else{
afterSettingsLoaded=new CustomEvent(
"RPxSettingsLoaded",
{
detail: {
message: 'done'
},
bubbles: true,
cancelable: true
}
);
}
var mapSettings=$.extend(defaultMapSettings, {});
WPR.map=new google.maps.Map(WPR.mapDiv, mapSettings);
bindMapEvent();
document.getElementById('listing_map').dispatchEvent(afterSettingsLoaded);
};
window.clearMapEvent=function (){
google.maps.event.clearListeners(WPR.map, 'idle');
}
window.bindMapEvent=function (){
new google.maps.event.addListener(WPR.map, 'idle', function (){
console.log(WPR.isBoundSearch);
if(WPR.isBoundSearch===false){
return true;
}
console.log("IN");
if(WPR.isGeoSearch){
return true;
}
if(WPR.preventRefresh&&WPR.isPolySearch&&0){
return true;
}
WPR.listingOffset=0;
if(WPR.preventRefresh&&WPR.infoWindowsCount < 1){
WPR.preventRefresh=false;
if(infowindow){
infowindow.close();
}
return true;
}else if(WPR.preventRefresh){
WPR.preventRefresh=false;
return true;
}else{
if(infowindow){
infowindow.close();
}}
toggleMapLoadingOverlay();
if(WPR.isPolySearch){
WPR.GetPolygon('Markers', WPR.polygon);
}else{
getListings('GetTemplatedListings');
getListings('GetMarkers');
}});
};
window.populateForm=function (data){
WPR[data.module]=WPR[data.module]||{};
WPR[data.module].settings=WPR[data.module].settings||{};
$.each(data.objectContents, function (key, value){
WPR[data.module].settings[key]=value;
if($('input[name="' + key + '"], select[name="' + key + '"]').length){
if($('input[name="' + key + '"]').length){
if($('input[name="' + key + '"]').attr('type')=='checkbox'){
$('input[name="' + key + '"]').attr('checked', value==='true');
if(value==='true')
jQuery.uniform.update();
}else if($('input[name="' + key + '"]').attr('type')=='radio'){
$('input[name="' + key + '"][value="' + value + '"]').attr('checked', true);
jQuery.uniform.update();
}else{
$('input[name="' + key + '"]').val(value);
}}else{
$('select[name="' + key + '"] option[value="' + value + '"]').attr('selected', 'selected');
if(typeof (jQuery.uniform)!=='undefined'&&typeof (jQuery.uniform.update)==='function')
jQuery.uniform.update();
}}
});
if(typeof (jQuery.uniform)!=='undefined'&&typeof (jQuery.uniform.update)==='function')
jQuery.uniform.update();
var afterFormLoaded=new CustomEvent(
"RPxAdminFormLoaded",
{
detail: {
message: 'done'
},
bubbles: true,
cancelable: true
}
);
document.getElementById('Settings').dispatchEvent(afterFormLoaded);
}
window.saveConfig=function (target){
var formData=formToObj('Settings');
var submitData=$.extend(formData, {controller: 'System', action: 'SetModuleSettings', module_name: $(target).data('module')});
$.getJSON(WPR.ajaxurl,
submitData,
function (data){
alert('Config Updated');
GetModuleConfig($(target).data('module'), populateForm);
});
}
WPR.MakeFieldSelect=function (data, meta){
var selector;
if(typeof meta!=='undefined'&&typeof meta.form!=='undefined')
selector='#' + meta.form + ' select[name=' + meta.selectName + ']';
else
selector='select[name=' + meta.selectName + ']';
if(data!==null){
$(selector).append($('
Select Field '));
$.each(data.objectContents, function (i, val){
if(meta.selected==val){
$(selector).append($('
' + val + ' '));
return;
}
$(selector).append($('
' + val + ' '));
});
}else{
$(selector).append($('
No Values Found '));
}
jQuery.uniform.update();
}
WPR.GetTableCols=function (callback, meta){
$.getJSON(WPR.ajaxurl,
{
controller: "System",
action: "GetTableFieldsFiltered",
tablename: meta.table
},
function (data){
callback(data, meta);
}
);
}
WPR.GetDistinctList=function (table, fieldname, callback){
$.get(WPR.ajaxurl,
{
controller: 'System',
action: 'GetDistinctList',
tablename: table,
fieldname: fieldname
},
function (data){
if(!data)
return;
var obj=$.parseJSON(data);
callback(obj.objectContents);
});
};
WPR.UploadFile=function (formEl, callback){
var formData=new FormData(formEl);
$.ajax({
url: WPR.ajaxurl + '?controller=System&action=UploadFile&module=' + $(formEl).data('module') + '&type=' + $(formEl).data('type'),
type: "POST",
data: formData,
contentType: false,
cache: false,
dataType: "json",
processData: false,
success: function (data){
callback({data: data, formData: formData, formEl: formEl});
}});
}
WPR.encodeFileName=function (filename){
if(filename==null)
return 'default_marker';
var encoded_name=filename.replace(/ /g, '--').replace(/\//g, '__');
return encoded_name;
}
WPR.decodeFileName=function (filename){
var decoded_filename=filename.replace(/--/g, ' ').replace(/__/g, '/');
return decoded_filename;
}
WPR.setTitle=function (element, newTitle){
$(element).attr('title', newTitle);
}
WPR.SetupSelects=function (){
$.each($(".live-select"), function (i, val){
;
WPR.GetTableCols(WPR.MakeFieldSelect,
{
module: $(this).attr('data-module'),
selectName: $(this).attr('name'),
selected: WPR[$(this).attr('data-module')]['settings'][$(this).attr('name')]||'',
table: $(this).attr('data-table')
})
})
}
$(document).ready(function (){
$.ajaxSetup({cache: false});
$(".icon-form").on('submit', function (e){
e.preventDefault();
WPR.UploadFile(this);
});
$('#UpdateConfig').click(function (e){
e.preventDefault();
saveConfig(this);
});
})
})(WPR.jq||jQuery, WPR, infowindow);
function localStorageAvailable(){
var type='localStorage';
try
{
var storage=window[type],
x='__storage_test__';
storage.setItem(x, x);
storage.removeItem(x);
return true;
} catch (e){
return false;
}}
function AddListingAction(idPrefix, idOrMls, classname, title){
jQuery('.listing_actions').each(function (){
var ident=jQuery(this).closest('.property_listing').data(idOrMls);
jQuery(this).append('
');
})
}
function RPxListingAction(){
this.addAction=function (classname){
jQuery.each(jQuery('.listing_actions'), function (i, v){
v.append('
woot ');
})
}};
jQuery(document).ready(function ($){
$('body').on('click', '.myaccount', function (e){
e.preventDefault();
WPR.operation=ShowAccount
CheckLogin();
});
$(document).on('click', '.closepop, .login_overlay', function (){
$('#modal-outer').fadeOut(500, function (){
$('.login_overlay').remove();
});
return false;
});
});
function ShowAccount(){
jQuery('body').prepend('
');
jQuery('#modal-outer').fadeIn(500);
jQuery('#modal-outer').html('');
jQuery('#modal-outer').append('
My Account
');
jQuery('#searches').append('
Saved Searches
');
jQuery('#favs').append('
Saved Properties
');
new jQueryCollapse(jQuery("#modal-outer"), {
query: 'div h3',
show: function (){
this.slideDown(300);
},
hide: function (){
this.slideUp(300);
},
persist: true
});
jQuery.getJSON(WPR.ajaxurl, {controller: 'System', action: 'GetSavedSearches'}, function (data){
jQuery('#srchres').append(data.objectContents);
});
jQuery.getJSON(WPR.ajaxurl, {controller: 'System', action: 'GetFavorites'}, function (data){
jQuery('#props').append(data.objectContents);
});
};
(function($){
function Collapse (el, options){
options=options||{};
var _this=this,
query=options.query||"> :even";
$.extend(_this, {
$el: el,
options:options,
sections: [],
isAccordion:options.accordion||false,
db:options.persist ? jQueryCollapseStorage(el.get(0).id):false
});
_this.states=_this.db ? _this.db.read():[];
_this.$el.find(query).each(function(){
new jQueryCollapseSection($(this), _this);
});
(function(scope){
_this.$el.on("click", "[data-collapse-summary] " + (scope.options.clickQuery||""),
$.proxy(_this.handleClick, scope));
_this.$el.bind("toggle close open",
$.proxy(_this.handleEvent, scope));
}(_this));
}
Collapse.prototype={
handleClick: function(e, state){
e.preventDefault();
var state=state||"toggle"
var sections=this.sections,
l=sections.length;
while(l--){
if($.contains(sections[l].$summary[0], e.target)){
sections[l][state]();
break;
}}
},
handleEvent: function(e){
if(e.target==this.$el.get(0)) return this[e.type]();
this.handleClick(e, e.type);
},
open: function(eq){
if(isFinite(eq)) return this.sections[eq].open();
$.each(this.sections, function(i, section){
section.open();
})
},
close: function(eq){
if(isFinite(eq)) return this.sections[eq].close();
$.each(this.sections, function(i, section){
section.close();
})
},
toggle: function(eq){
if(isFinite(eq)) return this.sections[eq].toggle();
$.each(this.sections, function(i, section){
section.toggle();
})
}};
function Section($el, parent){
if(!parent.options.clickQuery) $el.wrapInner('
');
$.extend(this, {
isOpen:false,
$summary:$el.attr("data-collapse-summary",""),
$details:$el.next(),
options: parent.options,
parent: parent
});
parent.sections.push(this);
var state=parent.states[this._index()];
if(state===0){
this.close(true)
}
else if(this.$summary.is(".open")||state===1){
this.open(true);
}else{
this.close(true)
}}
Section.prototype={
toggle:function(){
this.isOpen ? this.close():this.open();
},
close: function(bypass){
this._changeState("close", bypass);
},
open: function(bypass){
var _this=this;
if(_this.options.accordion&&!bypass){
$.each(_this.parent.sections, function(i, section){
section.close()
});
}
_this._changeState("open", bypass);
},
_index: function(){
return $.inArray(this, this.parent.sections);
},
_changeState: function(state, bypass){
var _this=this;
_this.isOpen=state=="open";
if($.isFunction(_this.options[state])&&!bypass){
_this.options[state].apply(_this.$details);
}else{
_this.$details[_this.isOpen ? "show":"hide"]();
}
_this.$summary.toggleClass("open", state!="close")
_this.$details.attr("aria-hidden", state=="close");
_this.$summary.attr("aria-expanded", state=="open");
_this.$summary.trigger(state=="open" ? "opened":"closed", _this);
if(_this.parent.db){
_this.parent.db.write(_this._index(), _this.isOpen);
}}
};
$.fn.extend({
collapse: function(options, scan){
var nodes=(scan) ? $("body").find("[data-collapse]"):$(this);
return nodes.each(function(){
var settings=(scan) ? {}:options,
values=$(this).attr("data-collapse")||"";
$.each(values.split(" "), function(i,v){
if(v) settings[v]=true;
});
new Collapse($(this), settings);
});
}});
$(function(){
$.fn.collapse(false, true);
});
jQueryCollapse=Collapse;
jQueryCollapseSection=Section;
})(window.jQuery);
(function($){
var STORAGE_KEY="jQuery-Collapse";
function Storage(id){
var DB;
try {
DB=window.localStorage||$.fn.collapse.cookieStorage;
} catch(e){
DB=false;
}
return DB ? new _Storage(id, DB):false;
}
function _Storage(id, DB){
this.id=id;
this.db=DB;
this.data=[];
}
_Storage.prototype={
write: function(position, state){
var _this=this;
_this.data[position]=state ? 1:0;
$.each(_this.data, function(i){
if(typeof _this.data[i]=='undefined'){
_this.data[i]=0;
}});
var obj=this._getDataObject();
obj[this.id]=this.data;
this.db.setItem(STORAGE_KEY, JSON.stringify(obj));
},
read: function(){
var obj=this._getDataObject();
return obj[this.id]||[];
},
_getDataObject: function(){
var string=this.db.getItem(STORAGE_KEY);
return string ? JSON.parse(string):{};}};
jQueryCollapseStorage=Storage;
})(jQuery);
jQuery(document).ready(function ($){
if(getCookie('wpr_login')){
if($('#wpadminbar').length){
$('#RPxToolbar').css('top', '35px');
}}
WPR.swapClass=function(el, remclass, newclass){
$(el).removeClass(remclass);
$(el).addClass(newclass);
}});
window.getCookie=function(cname){
var name=cname + "=";
var ca=document.cookie.split(';');
for(var i=0; i
' + place.name + ' ' +
'Place ID: ' + place.vicinity + ' ' +
place.formatted_address + '');
schoolInfoWindow.open(thisMap, this);
});
}}
});*/
});
$('#sold').on('change', function (){
if($(this).val()===''){
params.exclude='TRG:Sold';
}else{
delete params.exclude;
}
$('#maxprice').trigger('change');
})
if(typeof markersSrc!='undefined'&&markersSrc&&$('#remote-map').length){
var hope=new RPxRemoteMap();
var mapPoly=typeof mapPolygon!='undefined' ? mapPolygon:[];
hope.MapMarkers(markersSrc, mapPoly);
/*$('.property_listing').on('mouseenter', function(){
var id=$(this).attr('data-lid');
var infowindow=new google.maps.InfoWindow({
content: $('#infowindow_' + id).html()
});
infowindow.open(thisMap, mapPins[id]);
$('.listing_wrapper').on('mouseenter', function(){
infowindow.close();
})
})*/
}
if(typeof mapQuery!='undefined'&&typeof listingTemplate!='undefined'){
var params=JSON.parse(scParams)
$.post(WPR.ajaxurl,
{
controller: "MapSearch",
action: "GetAsyncScListings",
listing_template: listingTemplate,
query: mapQuery,
params: params
},
function (data){
$('#listing_area').html(data);
})
}
if(typeof mapQuery!='undefined'&&$('#remote-map').length){
$.get(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetMarkersFromQuery',
query: mapQuery
},
function (data){
if(!data)
return;
data=JSON.parse(data);
var hope=new RPxRemoteMap();
hope.MapMarkers(data.objectContents);
})
}
if(typeof scParams!='undefined'){
var params=JSON.parse(scParams);
if(typeof params['async_startup']!='undefined'&¶ms['async_startup']){
params['async_startup']=0;
params['async_refresh']=1;
params['filters']=formToObj('filters');
if(typeof infowindowTemplate!='undefined'&&infowindowTemplate){
$.post(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetScMarkersAsync',
infowindow_template: infowindowTemplate,
params: params,
type: 'markers'
},
function (data){
var hope=new RPxRemoteMap();
if(data){
data=JSON.parse(data);
hope.MapMarkers(data.objectContents);
}else{
hope.MapMarkers([]);
}
var listings;
if(typeof listingTemplate!='undefined'&&listingTemplate){
thisMap.addListener('idle', function (e){
var mapBounds=thisMap.getBounds();
var listings=[];
$.each(markersArr, function (i, v){
if(mapBounds.contains(v.position)){
listings.push(v.lid);
if(listings.length==30)
return false;
}})
if(!listings.length){
$('#listing_area').html('
No listings match your search
');
$('#result-count').html('No Results');
return;
}else{
$('#result-count').html(markersArr.length + ' results');
}
$.get(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetListingsByIds',
listings: listings,
listing_template: listingTemplate
},
function (data){
$('#listing_area').html(data);
var afterListingsInserted;
if(navigator.appName=='Microsoft Internet Explorer'||navigator.appName=='Netscape'){
afterListingsInserted=document.createEvent('CustomEvent');
afterListingsInserted.initCustomEvent("RPxScListingsInserted", true, true, {message: 'done'});
}else{
afterListingsInserted=new CustomEvent(
"RPxScListingsInserted",
{
detail: {
message: 'done'
},
bubbles: true,
cancelable: true
}
);
}
document.getElementById('listing_area').dispatchEvent(afterListingsInserted);
})
})
if(markersArr.length < 30){
listings=markersArr.slice();
}else{
listings=markersArr.slice(0, 30);
}
if(!listings.length){
$('#listing_area').html('
No listings match your search
');
$('#result-count').html('No Results');
return;
}
var listingsArr=[];
$.each(listings, function (i, v){
listingsArr.push(v.lid);
})
$.get(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetListingsByIds',
listings: listingsArr,
listing_template: listingTemplate
},
function (data){
$('#listing_area').html(data);
var afterListingsInserted;
if(navigator.appName=='Microsoft Internet Explorer'||navigator.appName=='Netscape'){
afterListingsInserted=document.createEvent('CustomEvent');
afterListingsInserted.initCustomEvent("RPxScListingsInserted", true, true, {message: 'done'});
}else{
afterListingsInserted=new CustomEvent(
"RPxScListingsInserted",
{
detail: {
message: 'done'
},
bubbles: true,
cancelable: true
}
);
}
document.getElementById('listing_area').dispatchEvent(afterListingsInserted);
})
}})
}
/*if(typeof listingTemplate!='undefined'&&listingTemplate){
$.post(WPR.ajaxurl,
{
controller: "MapSearch",
action: "GetScListingsAsync",
listing_template: listingTemplate,
params: params,
type: 'listings'
},
function(data){
$('#listing_area').html(data);
})
}*/
}
$('.server_select').each(function (i, Element){
makeSelectListEx($(this).attr('name'), true);
})
$('.map-filter-textbox, .map-filter-mls-textbox').on('input propertychange paste', function (){
if($(this).val().length==1){
var first=$(this).val();
document.getElementById('filters').reset();
$('.map-filter-zip-textbox').val('');
$(this).val(first);
}else if($(this).val().length==7){
$('.map-filter-ddl').first().trigger('change');
}})
$('.map-filter-zip-textbox').on('input propertychange paste', function (){
if($(this).val().length==1){
var first=$(this).val();
document.getElementById('filters').reset();
$('.map-filter-textbox, .map-filter-mls-textbox').val('');
$(this).val(first);
}else if($(this).val().length==5){
$('.map-filter-ddl').first().trigger('change');
}})
$('body').on('change', '.map-filter-ddl', function (){
markerCluster.clearMarkers()
for (i=0; i < markersArr.length; i++){
markersArr[i].setMap(null);
}
markersArr=[];
mapPins=[];
var filters=formToObj('filters');
params['filters']=filters;
$.post(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetScMarkersAsync',
infowindow_template: infowindowTemplate,
params: params,
type: 'markers'
},
function (data){
if(!data){
$('#listing_area').html('
No listings match your search
');
$('#result-count').html('No Results');
return;
}
data=JSON.parse(data);
var hope=new RPxRemoteMap();
hope.MapMarkers('', mapPolygon);
var mapBounds=thisMap.getBounds();
var listings=[];
$.each(markersArr, function (i, v){
if(mapBounds.contains(v.position)){
listings.push(v.lid);
if(listings.length==30)
return false;
}})
if(typeof listingTemplate=='undefined')
return;
$.get(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetListingsByIds',
listings: listings,
listing_template: listingTemplate
},
function (data){
$('#listing_area').html(data);
$('#result-count').html(markersArr.length + ' results');
var afterListingsInserted;
if(navigator.appName=='Microsoft Internet Explorer'||navigator.appName=='Netscape'){
afterListingsInserted=document.createEvent('CustomEvent');
afterListingsInserted.initCustomEvent("RPxScListingsInserted", true, true, {message: 'done'});
}else{
afterListingsInserted=new CustomEvent(
"RPxScListingsInserted",
{
detail: {
message: 'done'
},
bubbles: true,
cancelable: true
}
);
}
document.getElementById('listing_area').dispatchEvent(afterListingsInserted);
})
})
/*if(typeof listingTemplate!='undefined'&&listingTemplate){
$.post(WPR.ajaxurl,
{
controller: "MapSearch",
action: "GetScListingsAsync",
listing_template: listingTemplate,
params: params,
type: 'listings'
},
function(data){
$('#listing_area').html(data);
})
}*/
})
}});
function showSchools(searchBounds){
if(thisMap.getZoom() < 14){
$.each(schools, function (i, v){
v.setMap(null);
})
schools=[];
return;
}
var service=new google.maps.places.PlacesService(thisMap);
var request={bounds: searchBounds, type: "school"};
service.textSearch(request, function (results, status){
if(status==google.maps.places.PlacesServiceStatus.OK){
for (var i=0; i < results.length; i++){
var place=results[i];
var marker=new google.maps.Marker({
map: thisMap,
position: place.geometry.location,
icon: "/wpradmin/template/enfold/Modules/MapSearch/markers/default_School.png"
});
marker.rpx=place;
google.maps.event.addListener(marker, 'mouseover', function (){
schoolInfoWindow.setContent('
' + this.rpx.name + ' ' + this.rpx.formatted_address + '
');
if(typeof infowindow_global!='undefined'){
infowindow_global.close();
}
schoolInfoWindow.open(thisMap, this);
});
schools.push(marker);
}}
});
}
function clusterCalc2(markers, styles){
var count=markers.length;
var ndx;
var text;
if(count < 20){
ndx=1;
}else if(count < 100){
ndx=2;
}else{
ndx=3;
}
text=WPR.map.getZoom() > 11 ? count + '+':'+';
return {index: ndx, text: text, title: "Click to Zoom"};}
function makeSelectListEx(fieldname, realSelect){
jQuery.get(WPR.ajaxurl,
{
controller: 'MapSearch',
action: 'GetDistinctValues',
fieldname: fieldname
},
function (data){
var obj=jQuery.parseJSON(data);
if(typeof obj.objectContents.results.errormsg!='undefined'){
alert(obj.objectContents.results.errormsg);
}
if(realSelect){
jQuery.each(obj.objectContents.results, function (i, val){
tpl='
' + val[1] + ' ';
jQuery('#filters select[name=' + fieldname + ']').append(jQuery.parseHTML(tpl));
});
return;
}
var firstItem=jQuery('#select_' + fieldname + ' li:first-child');
jQuery('#select_' + fieldname).html('');
jQuery('#select_' + fieldname).append(firstItem);
jQuery.each(obj.objectContents.results, function (i, val){
tpl='
' + val[1] + ' ';
jQuery('#select_' + fieldname).append(jQuery.parseHTML(tpl));
});
});
};
function InfoBox(opt_opts){
opt_opts=opt_opts||{};
google.maps.OverlayView.apply(this, arguments);
this.content_=opt_opts.content||"";
this.disableAutoPan_=opt_opts.disableAutoPan||false;
this.maxWidth_=opt_opts.maxWidth||0;
this.pixelOffset_=opt_opts.pixelOffset||new google.maps.Size(0, 0);
this.position_=opt_opts.position||new google.maps.LatLng(0, 0);
this.zIndex_=opt_opts.zIndex||null;
this.boxClass_=opt_opts.boxClass||"infoBox";
this.boxStyle_=opt_opts.boxStyle||{};
this.closeBoxMargin_=opt_opts.closeBoxMargin||"2px";
this.closeBoxURL_=opt_opts.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif";
if(opt_opts.closeBoxURL===""){
this.closeBoxURL_="";
}
this.infoBoxClearance_=opt_opts.infoBoxClearance||new google.maps.Size(1, 1);
if(typeof opt_opts.visible==="undefined"){
if(typeof opt_opts.isHidden==="undefined"){
opt_opts.visible=true;
}else{
opt_opts.visible = !opt_opts.isHidden;
}}
this.isHidden_ = !opt_opts.visible;
this.alignBottom_=opt_opts.alignBottom||false;
this.pane_=opt_opts.pane||"floatPane";
this.enableEventPropagation_=opt_opts.enableEventPropagation||false;
this.div_=null;
this.closeListener_=null;
this.moveListener_=null;
this.contextListener_=null;
this.eventListeners_=null;
this.fixedWidthSet_=null;
}
InfoBox.prototype=new google.maps.OverlayView();
InfoBox.prototype.createInfoBoxDiv_=function (){
var i;
var events;
var bw;
var me=this;
var cancelHandler=function (e){
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}};
var ignoreHandler=function (e){
e.returnValue=false;
if(e.preventDefault){
e.preventDefault();
}
if(!me.enableEventPropagation_){
cancelHandler(e);
}};
if(!this.div_){
this.div_=document.createElement("div");
this.setBoxStyle_();
if(typeof this.content_.nodeType==="undefined"){
this.div_.innerHTML=this.getCloseBoxImg_() + this.content_;
}else{
this.div_.innerHTML=this.getCloseBoxImg_();
this.div_.appendChild(this.content_);
}
this.getPanes()[this.pane_].appendChild(this.div_);
this.addClickHandler_();
if(this.div_.style.width){
this.fixedWidthSet_=true;
}else{
if(this.maxWidth_!==0&&this.div_.offsetWidth > this.maxWidth_){
this.div_.style.width=this.maxWidth_;
this.div_.style.overflow="auto";
this.fixedWidthSet_=true;
}else{
bw=this.getBoxWidths_();
this.div_.style.width=(this.div_.offsetWidth - bw.left - bw.right) + "px";
this.fixedWidthSet_=false;
}}
this.panBox_(this.disableAutoPan_);
if(!this.enableEventPropagation_){
this.eventListeners_=[];
events=["mousedown", "mouseover", "mouseout", "mouseup",
"click", "dblclick", "touchstart", "touchend", "touchmove"];
for (i=0; i < events.length; i++){
this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler));
}
this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (e){
this.style.cursor="default";
}));
}
this.contextListener_=google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler);
google.maps.event.trigger(this, "domready");
}};
InfoBox.prototype.getCloseBoxImg_=function (){
var img="";
if(this.closeBoxURL_!==""){
img="
";
}
return img;
};
InfoBox.prototype.addClickHandler_=function (){
var closeBox;
if(this.closeBoxURL_!==""){
closeBox=this.div_.firstChild;
this.closeListener_=google.maps.event.addDomListener(closeBox, "click", this.getCloseClickHandler_());
}else{
this.closeListener_=null;
}};
InfoBox.prototype.getCloseClickHandler_=function (){
var me=this;
return function (e){
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}
google.maps.event.trigger(me, "closeclick");
me.close();
};};
InfoBox.prototype.panBox_=function (disablePan){
var map;
var bounds;
var xOffset=0, yOffset=0;
if(!disablePan){
map=this.getMap();
if(map instanceof google.maps.Map){
if(!map.getBounds().contains(this.position_)){
map.setCenter(this.position_);
}
bounds=map.getBounds();
var mapDiv=map.getDiv();
var mapWidth=mapDiv.offsetWidth;
var mapHeight=mapDiv.offsetHeight;
var iwOffsetX=this.pixelOffset_.width;
var iwOffsetY=this.pixelOffset_.height;
var iwWidth=this.div_.offsetWidth;
var iwHeight=this.div_.offsetHeight;
var padX=this.infoBoxClearance_.width;
var padY=this.infoBoxClearance_.height;
var pixPosition=this.getProjection().fromLatLngToContainerPixel(this.position_);
if(pixPosition.x < (-iwOffsetX + padX)){
xOffset=pixPosition.x + iwOffsetX - padX;
}else if((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth){
xOffset=pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
}
if(this.alignBottom_){
if(pixPosition.y < (-iwOffsetY + padY + iwHeight)){
yOffset=pixPosition.y + iwOffsetY - padY - iwHeight;
}else if((pixPosition.y + iwOffsetY + padY) > mapHeight){
yOffset=pixPosition.y + iwOffsetY + padY - mapHeight;
}}else{
if(pixPosition.y < (-iwOffsetY + padY)){
yOffset=pixPosition.y + iwOffsetY - padY;
}else if((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight){
yOffset=pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
}}
if(!(xOffset===0&&yOffset===0)){
var c=map.getCenter();
map.panBy(xOffset, yOffset);
}}
}};
InfoBox.prototype.setBoxStyle_=function (){
var i, boxStyle;
if(this.div_){
this.div_.className=this.boxClass_;
this.div_.style.cssText="";
boxStyle=this.boxStyle_;
for (i in boxStyle){
if(boxStyle.hasOwnProperty(i)){
this.div_.style[i]=boxStyle[i];
}}
this.div_.style.WebkitTransform="translateZ(0)";
if(typeof this.div_.style.opacity!=="undefined"&&this.div_.style.opacity!==""){
this.div_.style.MsFilter="\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (this.div_.style.opacity * 100) + ")\"";
this.div_.style.filter="alpha(opacity=" + (this.div_.style.opacity * 100) + ")";
}
this.div_.style.position="absolute";
this.div_.style.visibility='hidden';
if(this.zIndex_!==null){
this.div_.style.zIndex=this.zIndex_;
}}
};
InfoBox.prototype.getBoxWidths_=function (){
var computedStyle;
var bw={top: 0, bottom: 0, left: 0, right: 0};
var box=this.div_;
if(document.defaultView&&document.defaultView.getComputedStyle){
computedStyle=box.ownerDocument.defaultView.getComputedStyle(box, "");
if(computedStyle){
bw.top=parseInt(computedStyle.borderTopWidth, 10)||0;
bw.bottom=parseInt(computedStyle.borderBottomWidth, 10)||0;
bw.left=parseInt(computedStyle.borderLeftWidth, 10)||0;
bw.right=parseInt(computedStyle.borderRightWidth, 10)||0;
}}else if(document.documentElement.currentStyle){
if(box.currentStyle){
bw.top=parseInt(box.currentStyle.borderTopWidth, 10)||0;
bw.bottom=parseInt(box.currentStyle.borderBottomWidth, 10)||0;
bw.left=parseInt(box.currentStyle.borderLeftWidth, 10)||0;
bw.right=parseInt(box.currentStyle.borderRightWidth, 10)||0;
}}
return bw;
};
InfoBox.prototype.onRemove=function (){
if(this.div_){
this.div_.parentNode.removeChild(this.div_);
this.div_=null;
}};
InfoBox.prototype.draw=function (){
this.createInfoBoxDiv_();
var pixPosition=this.getProjection().fromLatLngToDivPixel(this.position_);
this.div_.style.left=(pixPosition.x + this.pixelOffset_.width) + "px";
if(this.alignBottom_){
this.div_.style.bottom=-(pixPosition.y + this.pixelOffset_.height) + "px";
}else{
this.div_.style.top=(pixPosition.y + this.pixelOffset_.height) + "px";
}
if(this.isHidden_){
this.div_.style.visibility="hidden";
}else{
this.div_.style.visibility="visible";
}};
InfoBox.prototype.setOptions=function (opt_opts){
if(typeof opt_opts.boxClass!=="undefined"){
this.boxClass_=opt_opts.boxClass;
this.setBoxStyle_();
}
if(typeof opt_opts.boxStyle!=="undefined"){
this.boxStyle_=opt_opts.boxStyle;
this.setBoxStyle_();
}
if(typeof opt_opts.content!=="undefined"){
this.setContent(opt_opts.content);
}
if(typeof opt_opts.disableAutoPan!=="undefined"){
this.disableAutoPan_=opt_opts.disableAutoPan;
}
if(typeof opt_opts.maxWidth!=="undefined"){
this.maxWidth_=opt_opts.maxWidth;
}
if(typeof opt_opts.pixelOffset!=="undefined"){
this.pixelOffset_=opt_opts.pixelOffset;
}
if(typeof opt_opts.alignBottom!=="undefined"){
this.alignBottom_=opt_opts.alignBottom;
}
if(typeof opt_opts.position!=="undefined"){
this.setPosition(opt_opts.position);
}
if(typeof opt_opts.zIndex!=="undefined"){
this.setZIndex(opt_opts.zIndex);
}
if(typeof opt_opts.closeBoxMargin!=="undefined"){
this.closeBoxMargin_=opt_opts.closeBoxMargin;
}
if(typeof opt_opts.closeBoxURL!=="undefined"){
this.closeBoxURL_=opt_opts.closeBoxURL;
}
if(typeof opt_opts.infoBoxClearance!=="undefined"){
this.infoBoxClearance_=opt_opts.infoBoxClearance;
}
if(typeof opt_opts.isHidden!=="undefined"){
this.isHidden_=opt_opts.isHidden;
}
if(typeof opt_opts.visible!=="undefined"){
this.isHidden_ = !opt_opts.visible;
}
if(typeof opt_opts.enableEventPropagation!=="undefined"){
this.enableEventPropagation_=opt_opts.enableEventPropagation;
}
if(this.div_){
this.draw();
}};
InfoBox.prototype.setContent=function (content){
this.content_=content;
if(this.div_){
if(this.closeListener_){
google.maps.event.removeListener(this.closeListener_);
this.closeListener_=null;
}
if(!this.fixedWidthSet_){
this.div_.style.width="";
}
if(typeof content.nodeType==="undefined"){
this.div_.innerHTML=this.getCloseBoxImg_() + content;
}else{
this.div_.innerHTML=this.getCloseBoxImg_();
this.div_.appendChild(content);
}
if(!this.fixedWidthSet_){
this.div_.style.width=this.div_.offsetWidth + "px";
if(typeof content.nodeType==="undefined"){
this.div_.innerHTML=this.getCloseBoxImg_() + content;
}else{
this.div_.innerHTML=this.getCloseBoxImg_();
this.div_.appendChild(content);
}}
this.addClickHandler_();
}
google.maps.event.trigger(this, "content_changed");
};
InfoBox.prototype.setPosition=function (latlng){
this.position_=latlng;
if(this.div_){
this.draw();
}
google.maps.event.trigger(this, "position_changed");
};
InfoBox.prototype.setZIndex=function (index){
this.zIndex_=index;
if(this.div_){
this.div_.style.zIndex=index;
}
google.maps.event.trigger(this, "zindex_changed");
};
InfoBox.prototype.setVisible=function (isVisible){
this.isHidden_ = !isVisible;
if(this.div_){
this.div_.style.visibility=(this.isHidden_ ? "hidden":"visible");
}};
InfoBox.prototype.getContent=function (){
return this.content_;
};
InfoBox.prototype.getPosition=function (){
return this.position_;
};
InfoBox.prototype.getZIndex=function (){
return this.zIndex_;
};
InfoBox.prototype.getVisible=function (){
var isVisible;
if((typeof this.getMap()==="undefined")||(this.getMap()===null)){
isVisible=false;
}else{
isVisible = !this.isHidden_;
}
return isVisible;
};
InfoBox.prototype.show=function (){
this.isHidden_=false;
if(this.div_){
this.div_.style.visibility="visible";
}};
InfoBox.prototype.hide=function (){
this.isHidden_=true;
if(this.div_){
this.div_.style.visibility="hidden";
}};
InfoBox.prototype.open=function (map, anchor){
var me=this;
if(anchor){
this.position_=anchor.getPosition();
this.moveListener_=google.maps.event.addListener(anchor, "position_changed", function (){
me.setPosition(this.getPosition());
});
}
this.setMap(map);
if(this.div_){
this.panBox_();
}};
InfoBox.prototype.close=function (){
var i;
if(this.closeListener_){
google.maps.event.removeListener(this.closeListener_);
this.closeListener_=null;
}
if(this.eventListeners_){
for (i=0; i < this.eventListeners_.length; i++){
google.maps.event.removeListener(this.eventListeners_[i]);
}
this.eventListeners_=null;
}
if(this.moveListener_){
google.maps.event.removeListener(this.moveListener_);
this.moveListener_=null;
}
if(this.contextListener_){
google.maps.event.removeListener(this.contextListener_);
this.contextListener_=null;
}
this.setMap(null);
};
var gmarkers=[];
var current_place=0;
var actions=[];
var categories=[];
var vertical_pan=-190;
var map_open=0;
var vertical_off=150;
var pins='';
var markers='';
var infoBox=null;
var category=null;
var width_browser=null;
var infobox_width=null;
var wraper_height=null;
var info_image=null;
var map;
var found_id;
var selected_id=jQuery('#gmap_wrapper').attr('data-post_id');
var curent_gview_lat=jQuery('#gmap_wrapper').attr('data-cur_lat');
var curent_gview_long=jQuery('#gmap_wrapper').attr('data-cur_long');
var heading=0;
var panorama;
var oms;
function initialize(){
"use strict";
if(curent_gview_lat===''){
curent_gview_lat=googlecode_property_vars.general_latitude;
}
if(curent_gview_long===''){
curent_gview_long=googlecode_property_vars.general_longitude;
}
var viewPlace=new google.maps.LatLng(curent_gview_lat,curent_gview_long);
var mapOptions={
flat:false,
noClear:false,
zoom: parseInt(googlecode_property_vars.page_custom_zoom),
scrollwheel: false,
draggable: true,
center: new google.maps.LatLng(curent_gview_lat,curent_gview_long),
streetViewControl:false,
mapTypeId: googlecode_property_vars.type.toLowerCase(),
disableDefaultUI: true
};
var mapOptions_intern={
flat:false,
noClear:false,
zoom: parseInt(googlecode_property_vars.page_custom_zoom),
scrollwheel: false,
draggable: true,
center: new google.maps.LatLng(curent_gview_lat,curent_gview_long),
streetViewControl:false,
mapTypeId: googlecode_property_vars.type.toLowerCase(),
disableDefaultUI: true
};
if(document.getElementById('googleMap')){
map=new google.maps.Map(document.getElementById('googleMap'), mapOptions);
}else if(document.getElementById('googleMapSlider')){
map=new google.maps.Map(document.getElementById('googleMapSlider'), mapOptions_intern);
}else{
return;
}
google.maps.visualRefresh=true;
if(mapfunctions_vars.map_style!==''){
var styles=JSON.parse(mapfunctions_vars.map_style);
map.setOptions({styles: styles});
}
google.maps.event.addListener(map, 'tilesloaded', function(){
jQuery('#gmap-loading').remove();
});
if(Modernizr.mq('only all and (max-width: 1025px)')){
map.setOptions({'draggable': false});
}
if(googlecode_property_vars.generated_pins==='0'){
pins=googlecode_property_vars.markers;
markers=jQuery.parseJSON(pins);
}else{
if(typeof(googlecode_regular_vars2)!=='undefined'&&googlecode_regular_vars2.markers2.length > 2){
pins=googlecode_regular_vars2.markers2;
markers=jQuery.parseJSON(pins);
}}
if(markers.length>0){
setMarkers(map, markers);
}
if(googlecode_property_vars.idx_status==='1'){
placeidx(map,markers);
}
if(mapfunctions_vars.show_g_search_status==='yes'&&googlecode_property_vars.small_map!=='1'){
set_google_search(map);
}
google.maps.event.trigger(gmarkers[found_id], 'click');
panorama=map.getStreetView();
panorama.setPosition(viewPlace);
heading=parseInt(googlecode_property_vars.camera_angle);
panorama.setPov(({
heading: heading,
pitch: 0
}));
google.maps.event.addListener(panorama, "closeclick", function(){
jQuery('#gmap-next,#gmap-prev ,#geolocation-button,#gmapzoomminus,#gmapzoomplus').show();
jQuery('#street-view').removeClass('mapcontrolon');
});
oms=new OverlappingMarkerSpiderfier(map);
setOms(gmarkers);
/* oms.addListener('spiderfy', function(markers){
});
oms.addListener('unspiderfy ', function(markers){
});
*/
}
if(typeof google==='object'&&typeof google.maps==='object'){
google.maps.event.addDomListener(window, 'load', initialize);
}
function toggleStreetView(){
"use strict";
if(panorama.visible){
panorama.setVisible(false);
jQuery('#gmap-next,#gmap-prev ,#geolocation-button,#gmapzoomminus,#gmapzoomplus').show();
jQuery('#street-view').removeClass('mapcontrolon');
jQuery('#street-view').html('
'+control_vars.street_view_on);
}else{
panorama.setVisible(true);
jQuery('#gmap-next,#gmap-prev ,#geolocation-button,#gmapzoomminus,#gmapzoomplus').hide();
jQuery('#street-view').addClass('mapcontrolon');
jQuery('#street-view').html('
'+control_vars.street_view_off);
}};
var pin_images=mapfunctions_vars.pin_images;
var images=jQuery.parseJSON(pin_images);
var ipad_time=0;
var infobox_id=0;
var shape={
coord: [1, 1, 1, 38, 38, 59, 59 , 1],
type: 'poly'
};
var mcOptions;
var mcluster;
var clusterStyles;
var pin_hover_storage;
var first_time_wpestate_show_inpage_ajax_half=0;
function wpestate_change_map_type(map_type){
if(map_type==='map-view-roadmap'){
map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
}else if(map_type==='map-view-satellite'){
map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
}else if(map_type==='map-view-hybrid'){
map.setMapTypeId(google.maps.MapTypeId.HYBRID);
}else if(map_type==='map-view-terrain'){
map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
}}
function setMarkers(map, locations){
"use strict";
var map_open;
var myLatLng;
var selected_id=parseInt(jQuery('#gmap_wrapper').attr('data-post_id'));
if(isNaN(selected_id)){
selected_id=parseInt(jQuery('#googleMapSlider').attr('data-post_id'),10);
}
var open_height=parseInt(mapfunctions_vars.open_height,10);
var closed_height=parseInt(mapfunctions_vars.closed_height,10);
var boxText=document.createElement("div");
width_browser=jQuery(window).width();
infobox_width=700;
vertical_pan=-215;
if(width_browser<900){
infobox_width=500;
}
if(width_browser<600){
infobox_width=400;
}
if(width_browser<400){
infobox_width=200;
}
var myOptions={
content: boxText,
disableAutoPan: true,
maxWidth: infobox_width,
boxClass:"mybox",
zIndex: null,
closeBoxMargin: "-13px 0px 0px 0px",
closeBoxURL: "",
infoBoxClearance: new google.maps.Size(1, 1),
isHidden: false,
pane: "floatPane",
enableEventPropagation: true
};
infoBox=new InfoBox(myOptions);
for (var i=0; i < locations.length; i++){
var beach=locations[i];
var id=beach[10];
var lat=beach[1];
var lng=beach[2];
var title=decodeURIComponent(beach[0]);
var pin=beach[8];
var counter=beach[3];
var image=decodeURIComponent(beach[4]);
var price=decodeURIComponent(beach[5]);
var single_first_type=decodeURIComponent(beach[6]);
var single_first_action=decodeURIComponent(beach[7]);
var link=decodeURIComponent(beach[9]);
var city=decodeURIComponent(beach[11]);
var area=decodeURIComponent(beach[12]);
var cleanprice=beach[13];
var rooms=beach[14];
var baths=beach[15];
var size=beach[16];
var single_first_type_name=decodeURIComponent(beach[17]);
var single_first_action_name=decodeURIComponent(beach[18]);
var agent_id=beach[19] ;
if(mapfunctions_vars.custom_search==='yes'){
var slug1=beach[20];
var val1=beach[21];
var how1=beach[22];
var slug2=beach[23];
var val2=beach[24];
var how2=beach[25];
var slug3=beach[26];
var val3=beach[27];
var how3=beach[28];
var slug4=beach[29];
var val4=beach[30];
var how4=beach[31];
var slug5=beach[32];
var val5=beach[33];
var how5=beach[34];
var slug6=beach[35];
var val6=beach[36];
var how6=beach[37];
var slug7=beach[38];
var val7=beach[39];
var how7=beach[40];
var slug8=beach[41];
var val8=beach[42];
var how8=beach[43];
if(typeof (val1)!=='number'){
val1=val1.replace(" ","-");
}
if(typeof (val2)!=='number'){
val2=val2.replace(" ","-");
}
if(typeof (val3)!=='number'){
val3=val3.replace(" ","-");
}
if(typeof (val4)!=='number'){
val4=val4.replace(" ","-");
}
if(typeof (val5)!=='number'){
val5=val5.replace(" ","-");
}
if(typeof (val6)!=='number'){
val6=val6.replace(" ","-");
}
if(typeof (val7)!=='number'){
val7=val7.replace(" ","-");
}
if(typeof (val8)!=='number'){
val8=val8.replace(" ","-");
}}
if(typeof(googlecode_regular_vars2)!=='undefined'&&typeof(googlecode_regular_vars2.markers2)!=='undefined'&&googlecode_regular_vars2.markers2.length > 2&&typeof (googlecode_regular_vars2.taxonomy)!=='undefined'){
if(googlecode_regular_vars2.taxonomy==='property_city'){
if(googlecode_regular_vars2.term===city){
createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4, slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8,single_first_type_name, single_first_action_name);
}}
if(googlecode_regular_vars2.taxonomy==='property_area'){
if(googlecode_regular_vars2.term===area){
createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4, slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8,single_first_type_name, single_first_action_name);
}}
if(googlecode_regular_vars2.taxonomy==='property_category'){
if(googlecode_regular_vars2.term===single_first_type){
createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4, slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8,single_first_type_name, single_first_action_name);
}}
if(googlecode_regular_vars2.taxonomy==='property_action_category'){
if(googlecode_regular_vars2.term===single_first_action){
createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4, slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8,single_first_type_name, single_first_action_name);
}}
}else if(typeof(googlecode_regular_vars2)!=='undefined'&&typeof(googlecode_regular_vars2.markers2)!=='undefined'&&googlecode_regular_vars2.markers2.length > 2&&typeof (googlecode_regular_vars2.agent_id)!=='undefined'){
if(parseInt(googlecode_regular_vars2.agent_id,10)===parseInt(agent_id,10)){
createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4, slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8,single_first_type_name, single_first_action_name);
}}else{
createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4, slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8,single_first_type_name, single_first_action_name);
}
if(selected_id===id){
found_id=i;
}}
if(mapfunctions_vars.generated_pins!=='0'){
myLatLng=new google.maps.LatLng(lat, lng);
pan_to_last_pin(myLatLng);
}
if(mapfunctions_vars.is_prop_list==='1'||mapfunctions_vars.is_tax==='1'){
show_pins_filters_from_file();
}}
function createMarker (size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,city,area,rooms,baths,cleanprice,slug1,val1,how1,slug2,val2,how2,slug3,val3,how3,slug4,val4,how4,slug5, val5, how5, slug6, val6, how6 ,slug7 ,val7, how7, slug8, val8, how8, single_first_type_name, single_first_action_name){
var new_title='';
var myLatLng=new google.maps.LatLng(lat,lng);
if(mapfunctions_vars.custom_search==='yes'){
new_title=title.replace('%',' ');
new_title=decodeURIComponent(new_title.replace(/\+/g,' '));
Encoder.EncodeType="entity";
new_title=Encoder.htmlDecode(new_title);
var marker=new google.maps.Marker({
position: myLatLng,
map: map,
icon: custompin(pin),
shape: shape,
title:new_title,
zIndex: counter,
image:image,
idul:id,
price:price,
category:single_first_type,
action:single_first_action,
link:link,
city:city,
area:area,
infoWindowIndex:i,
rooms:rooms,
baths:baths,
size:size,
cleanprice:cleanprice,
size:size,
category_name:single_first_type_name,
action_name:single_first_action_name,
slug1: slug1,
val1: val1,
howto1:how1,
slug2:slug2,
val2: val2,
howto2:how2,
slug3:slug3,
val3: val3,
howto3:how3,
slug4:slug4,
val4: val4,
howto4:how4,
slug5:slug5,
val5: val5,
howto5:how5,
slug6:slug6,
val6: val6,
howto6:how7,
slug7:slug7,
val7: val7,
howto7:how7,
slug8:slug8,
val8: val8,
howto8:how8
});
}else{
var marker=new google.maps.Marker({
position: myLatLng,
map: map,
icon: custompin(pin),
shape: shape,
title: title,
zIndex: counter,
image:image,
idul:id,
price:price,
category:single_first_type,
action:single_first_action,
link:link,
city:city,
area:area,
infoWindowIndex:i,
rooms:rooms,
baths:baths,
cleanprice:cleanprice,
size:size,
category_name:single_first_type_name,
action_name:single_first_action_name
});
}
gmarkers.push(marker);
google.maps.event.addListener(marker, 'click', function(event){
map_callback(new_open_close_map);
google.maps.event.trigger(map, 'resize');
if(this.image===''){
info_image='
';
}else{
info_image=this.image;
}
var category=decodeURIComponent(this.category.replace(/-/g,' '));
var action=decodeURIComponent(this.action.replace(/-/g,' '));
var category_name=decodeURIComponent(this.category_name.replace(/-/g,' '));
var action_name=decodeURIComponent(this.action_name.replace(/-/g,' '));
var in_type=mapfunctions_vars.in_text;
if(category===''||action===''){
in_type=" ";
}
var infobaths;
if(this.baths!=''){
infobaths='
'+this.baths+' ';
}else{
infobaths='';
}
var inforooms;
if(this.rooms!=''){
inforooms='
'+this.rooms+' ';
}else{
inforooms='';
}
var infosize;
if(this.size!=''){
infosize='
'+this.size;
if(mapfunctions_vars.measure_sys==='ft'){
infosize=infosize+ ' ft2 ';
}else{
infosize=infosize+' m2 ';
}
infosize=infosize+' ';
}else{
infosize='';
}
var title=this.title.substr(0, 45)
if(this.title.length > 45){
title=title+"...";
}
infoBox.setContent('
');
infoBox.open(map, this);
map.setCenter(this.position);
switch (infobox_width){
case 700:
if(mapfunctions_vars.listing_map==='top'){
map.panBy(100,-150);
}else{
if(mapfunctions_vars.small_slider_t==='vertical'){
map.panBy(300,-300);
}else{
map.panBy(10,-110);
}}
vertical_off=0;
break;
case 500:
map.panBy(50,-120);
break;
case 400:
map.panBy(100,-220);
break;
case 200:
map.panBy(20,-170);
break;
}
if(control_vars.show_adv_search_map_close==='no'){
$('.search_wrapper').addClass('adv1_close');
adv_search_click();
}
close_adv_search();
});/////////////////////////////////// end event listener
if(mapfunctions_vars.generated_pins!=='0'){
pan_to_last_pin(myLatLng);
}}
function pan_to_last_pin(myLatLng){
map.setCenter(myLatLng);
}
function setOms(gmarkers){
for (var i=0; i < gmarkers.length; i++){
if(typeof oms!=='undefined'){
oms.addMarker(gmarkers[i]);
}else{
}}
}
function set_google_search(map){
var input,searchBox,places;
input=(document.getElementById('google-default-search'));
searchBox=new google.maps.places.SearchBox(input);
google.maps.event.addListener(searchBox, 'places_changed', function(){
places=searchBox.getPlaces();
if(places.length==0){
return;
}
var bounds=new google.maps.LatLngBounds();
for (var i=0, place; place=places[i]; i++){
var image={
url: place.icon,
size: new google.maps.Size(71, 71),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(17, 34),
scaledSize: new google.maps.Size(25, 25)
};
var marker=new google.maps.Marker({
map: map,
icon: image,
title: place.name,
position: place.geometry.location
});
gmarkers.push(marker);
bounds.extend(place.geometry.location);
}
map.fitBounds(bounds);
map.setZoom(15);
});
google.maps.event.addListener(map, 'bounds_changed', function(){
var bounds=map.getBounds();
searchBox.setBounds(bounds);
});
}
function new_open_close_map(type){
if(jQuery('#gmap_wrapper').hasClass('fullmap')){
return;
}
if(mapfunctions_vars.open_close_status!=='1'){
var current_height=jQuery('#googleMap').outerHeight();
var closed_height=parseInt(mapfunctions_vars.closed_height,10);
var open_height=parseInt(mapfunctions_vars.open_height,10);
var googleMap_h=open_height;
var gmapWrapper_h=open_height;
if(infoBox!==null){
infoBox.close();
}
if(current_height===closed_height){
googleMap_h=open_height;
if(Modernizr.mq('only all and (max-width: 940px)')){
gmapWrapper_h=open_height;
}else{
jQuery('#gmap-menu').show();
gmapWrapper_h=open_height;
}
new_show_advanced_search();
vertical_off=0;
jQuery('#openmap').empty().append('
'+mapfunctions_vars.close_map);
}else if(type===2){
jQuery('#gmap-menu').hide();
jQuery('#advanced_search_map_form').hide();
googleMap_h=gmapWrapper_h=closed_height;
new_hide_advanced_search();
vertical_off=150;
}
jQuery('#googleMap').animate({'height': googleMap_h+'px'});
jQuery('#gmap_wrapper').animate({'height': gmapWrapper_h+'px'},300,function(){
google.maps.event.trigger(map, "resize");
jQuery('.tooltip').fadeOut("fast");
})
}}
function map_cluster(){
if(mapfunctions_vars.user_cluster==='yes'){
clusterStyles=[
{
textColor: '#ffffff',
opt_textColor: '#ffffff',
url: mapfunctions_vars.path+'/cloud.png',
height: 72,
width: 72,
textSize:15,
}
];
mcOptions={gridSize: 50,
ignoreHidden:true,
maxZoom: mapfunctions_vars.zoom_cluster,
styles: clusterStyles
};
mcluster=new MarkerClusterer(map, gmarkers, mcOptions);
mcluster.setIgnoreHidden(true);
}}
if(document.getElementById('gmapzoomplus')){
google.maps.event.addDomListener(document.getElementById('gmapzoomplus'), 'click', function (){
var current=parseInt(map.getZoom(),10);
current++;
if(current>20){
current=20;
}
map.setZoom(current);
});
}
if(document.getElementById('gmapzoomminus')){
google.maps.event.addDomListener(document.getElementById('gmapzoomminus'), 'click', function (){
var current=parseInt(map.getZoom(),10);
current--;
if(current<0){
current=0;
}
map.setZoom(current);
});
}
if(document.getElementById('geolocation-button')){
google.maps.event.addDomListener(document.getElementById('geolocation-button'), 'click', function (){
myposition(map);
close_adv_search();
});
}
if(document.getElementById('mobile-geolocation-button')){
google.maps.event.addDomListener(document.getElementById('mobile-geolocation-button'), 'click', function (){
myposition(map);
close_adv_search();
});
}
jQuery('#mobile-geolocation-button,#geolocation-button').click(function(){
myposition(map);
})
function myposition(map){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(showMyPosition,errorCallback,{timeout:10000});
}else{
alert(mapfunctions_vars.geo_no_brow);
}}
function errorCallback(){
alert(mapfunctions_vars.geo_no_pos);
}
function showMyPosition(pos){
var shape={
coord: [1, 1, 1, 38, 38, 59, 59 , 1],
type: 'poly'
};
var MyPoint=new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
map.setCenter(MyPoint);
var marker=new google.maps.Marker({
position: MyPoint,
map: map,
icon: custompinchild(),
shape: shape,
title: '',
zIndex: 999999999,
image:'',
price:'',
category:'',
action:'',
link:'' ,
infoWindowIndex:99 ,
radius: parseInt(mapfunctions_vars.geolocation_radius,10)+' '+mapfunctions_vars.geo_message
});
var populationOptions={
strokeColor: '#67cfd8',
strokeOpacity: 0.6,
strokeWeight: 1,
fillColor: '#67cfd8',
fillOpacity: 0.2,
map: map,
center: MyPoint,
radius: parseInt(mapfunctions_vars.geolocation_radius,10)
};
var cityCircle=new google.maps.Circle(populationOptions);
var label=new Label({
map: map
});
label.bindTo('position', marker);
label.bindTo('text', marker, 'radius');
label.bindTo('visible', marker);
label.bindTo('clickable', marker);
label.bindTo('zIndex', marker);
}
function custompinchild(){
"use strict";
var custom_img;
if(images['userpin']===''){
custom_img=mapfunctions_vars.path+'/'+'userpin'+'.png';
}else{
custom_img=images['userpin'];
}
var image={
url: custom_img,
size: new google.maps.Size(59, 59),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(16,59)
};
return image;
}
jQuery('#googleMap').click(function(event){
var time_diff;
time_diff=event.timeStamp-ipad_time;
if(time_diff>300){
ipad_time=event.timeStamp;
jQuery('.tooltip').fadeOut("fast");
if(Modernizr.mq('only all and (max-width: 1025px)')){
if(map.draggable===false){
map.setOptions({'draggable': true});
}else{
map.setOptions({'draggable': false});
}}
}});
if(document.getElementById('gmap')){
google.maps.event.addDomListener(document.getElementById('gmap'), 'mouseout', function (){
google.maps.event.trigger(map, "resize");
});
}
if(document.getElementById('search_map_button')){
google.maps.event.addDomListener(document.getElementById('search_map_button'), 'click', function (){
infoBox.close();
});
}
if(document.getElementById('advanced_search_map_button')){
google.maps.event.addDomListener(document.getElementById('advanced_search_map_button'), 'click', function (){
infoBox.close();
});
}
jQuery('#gmap-next').click(function(){
current_place++;
if(current_place>gmarkers.length){
current_place=1;
}
while(gmarkers[current_place-1].visible===false){
current_place++;
if(current_place>gmarkers.length){
current_place=1;
}}
if(map.getZoom() <15){
map.setZoom(15);
}
google.maps.event.trigger(gmarkers[current_place-1], 'click');
});
jQuery('#gmap-prev').click(function(){
current_place--;
if(current_place<1){
current_place=gmarkers.length;
}
while(gmarkers[current_place-1].visible===false){
current_place--;
if(current_place>gmarkers.length){
current_place=1;
}}
if(map.getZoom() <15){
map.setZoom(15);
}
google.maps.event.trigger(gmarkers[current_place-1], 'click');
});
jQuery('.advanced_action_div li').click(function(){
var action=jQuery(this).val();
});
if(document.getElementById('gmap-menu')){
google.maps.event.addDomListener(document.getElementById('gmap-menu'), 'click', function (event){
infoBox.close();
if(event.target.nodeName==='INPUT'){
category=event.target.className;
if(event.target.name==="filter_action[]"){
if(actions.indexOf(category)!==-1){
actions.splice(actions.indexOf(category),1);
}else{
actions.push(category);
}}
if(event.target.name==="filter_type[]"){
if(categories.indexOf(category)!==-1){
categories.splice(categories.indexOf(category),1);
}else{
categories.push(category);
}}
show(actions,categories);
}});
}
function visible_or_not(how, slug, value, read){
if(value!==''&&typeof(value)!=='undefined'){
}
if(slug!==''&&typeof(slug)!=='undefined'){
}
if(read==='property_price'&&mapfunctions_vars.slider_price==='yes'){
var slider_min=parseInt(jQuery('#price_low').val());
var slider_max=parseInt(jQuery('#price_max').val());
if(slug >=slider_min&&slug<=slider_max){
return true;
}else{
return false;
}}
if(read==='none'){
return true;
}
if(value!==''&&value!==' '&&value!=='all'){
var parsevalue=parseInt(value, 10);
if(how==='greater'){
if(slug >=parsevalue){
return true
}else{
return false;
}}else if(how==='smaller'){
slug=parseInt(slug, 10);
if(slug <=parsevalue){
return true;
}else{
return false;
}}else if(how==='equal'){
if(String(slug)===value||value=='all'){
return true;
}else{
return false;
}}else if(how==='like'){
slug=slug.toLowerCase();
slug=decodeURI(slug);
value=value.toLowerCase();
value=decodeURI(value);
slug=slug.split(' ').join('-');
value=value.split(' ').join('-');
if(slug.indexOf(value)> -1){
return true;
}else{
return false;
}}else if(how==='date bigger'){
slug=new Date(slug);
value=new Date(value);
if(slug >=value){
return true;
}else{
return false;
}}else if(how==='date smaller'){
slug=new Date(slug);
value=new Date(value);
if(slug <=value){
return true;
}else{
return false;
}}
}else{
return true;
}}
function get_custom_value(slug){
var value;
if(slug==='adv_categ'||slug==='adv_actions'||slug==='advanced_city'||slug==='advanced_area'||slug==='county-state'){
value=jQuery('#'+slug).attr('data-value');
}else if(slug==='property_price'&&mapfunctions_vars.slider_price==='yes'){
value=jQuery('#price_low').val();
}else if(slug==='property-country'){
value=jQuery('#advanced_country').attr('data-value');
}else{
if(jQuery('#'+slug).hasClass('filter_menu_trigger')){
value=jQuery('#'+slug).attr('data-value');
}else{
value=jQuery('#'+slug).val() ;
}}
if(typeof(value)!=='undefined'){
value=value .replace(" ","-");
}
return value;
}
function show_pins_custom_search(){
var val1, val2, val3, val4, val5, val6, val7, val8, position;
val1=get_custom_value (mapfunctions_vars.slugs[0]);
val2=get_custom_value (mapfunctions_vars.slugs[1]);
val3=get_custom_value (mapfunctions_vars.slugs[2]);
val4=get_custom_value (mapfunctions_vars.slugs[3]);
val5=get_custom_value (mapfunctions_vars.slugs[4]);
val6=get_custom_value (mapfunctions_vars.slugs[5]);
val7=get_custom_value (mapfunctions_vars.slugs[6]);
val8=get_custom_value (mapfunctions_vars.slugs[7]);
position=parseInt(mapfunctions_vars.slider_price_position);
if(mapfunctions_vars.slider_price==='yes'&&position>0){
eval("val"+String(mapfunctions_vars.slider_price_position)+"="+jQuery('#price_low').val()+";");
eval("val"+String(position+1)+"="+jQuery('#price_max').val()+";");
}
if(typeof(val1)==='undefined'){
val1='';
}
if(typeof(val2)==='undefined'){
val2='';
}
if(typeof(val3)==='undefined'){
val3='';
}
if(typeof(val4)==='undefined'){
val4='';
}
if(typeof(val5)==='undefined'){
val5='';
}
if(typeof(val6)==='undefined'){
val6='';
}
if(typeof(val7)==='undefined'){
val7='';
}
if(typeof(val8)==='undefined'){
val8='';
}
if(typeof infoBox!=='undefined'&&infoBox!==null){
infoBox.close();
}
var results_no=0;
var bounds=new google.maps.LatLngBounds();
if(!isNaN(mcluster)){
mcluster.setIgnoreHidden(true);
}
if(typeof gmarkers!=='undefined'){
for (var i=0; i
price_max&&price_max!==0){
gmarkers[i].setVisible(false);
}else{
gmarkers[i].setVisible(true);
results_no++;
bounds.extend(gmarkers[i].getPosition());
}}
}
if(mapfunctions_vars.generated_pins==='0'||googlecode_regular_vars2.half_map_results=='1'){
if(results_no===0){
jQuery('#gmap-noresult').show();
jQuery('#results').hide();
}else{
jQuery('#gmap-noresult').hide();
if(!bounds.isEmpty()){
map.fitBounds(bounds);
}
jQuery("#results, #showinpage,#showinpage_mobile").show();
jQuery("#results_no").show().empty().append(results_no);
if(parseInt(mapfunctions_vars.is_half)===1){
if(first_time_wpestate_show_inpage_ajax_half===0){
first_time_wpestate_show_inpage_ajax_half=1
}else{
wpestate_show_inpage_ajax_half();
}}
}}else{
get_filtering_ajax_result();
if(!bounds.isEmpty()){
map.fitBounds(bounds);
}
if(mapfunctions_vars.adv_search_type===2||mapfunctions_vars.adv_search_type==='2'){
wpestate_show_inpage_ajax_tip2();
}}
if(typeof(mcluster)!=='undefined'){
mcluster.repaint();
}}
function wpestate_show_inpage_ajax_tip2(){
if(jQuery('#gmap-full').hasClass('spanselected')){
jQuery('#gmap-full').trigger('click');
}
if(mapfunctions_vars.custom_search==='yes'){
custom_search_start_filtering_ajax(1);
}else{
start_filtering_ajax(1);
}}
function wpestate_show_inpage_ajax_half(){
jQuery('.half-pagination').remove();
if(mapfunctions_vars.custom_search==='yes'){
custom_search_start_filtering_ajax(1);
}else{
start_filtering_ajax(1);
}}
function enable_half_map_pin_action (){
jQuery('#google_map_prop_list_sidebar .listing_wrapper').hover(function(){
var listing_id=jQuery(this).attr('data-listid');
wpestate_hover_action_pin(listing_id);
}, function(){
var listing_id=jQuery(this).attr('data-listid');
wpestate_return_hover_action_pin(listing_id);
}
);
}
function convertToSlug(Text){
return Text
.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'')
;
}
function custompin(image){
"use strict";
var custom_img;
if(image!==''){
if(images[image]===''){
custom_img=mapfunctions_vars.path+'/'+image+'.png';
}else{
custom_img=images[image];
}}else{
custom_img=mapfunctions_vars.path+'/none.png';
}
if(typeof (custom_img)==='undefined'){
custom_img=mapfunctions_vars.path+'/none.png';
}
image={
url: custom_img,
size: new google.maps.Size(59, 59),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(16,49)
};
return image;
}
function custompin2(image){
"use strict";
image={
url: mapfunctions_vars.path+'/'+image+'.png',
size: new google.maps.Size(59, 59),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(16,59)
};
return image;
}
function Label(opt_options){
this.setValues(opt_options);
var span=this.span_=document.createElement('span');
span.style.cssText='position: relative; left: -50%; top: 8px; ' +
'white-space: nowrap; ' +
'padding: 2px; background-color: white;opacity:0.7';
var div=this.div_=document.createElement('div');
div.appendChild(span);
div.style.cssText='position: absolute; display: none';
};
Label.prototype=new google.maps.OverlayView;
Label.prototype.onAdd=function(){
var pane=this.getPanes().overlayImage;
pane.appendChild(this.div_);
var me=this;
this.listeners_=[
google.maps.event.addListener(this, 'position_changed', function(){ me.draw(); }),
google.maps.event.addListener(this, 'visible_changed', function(){ me.draw(); }),
google.maps.event.addListener(this, 'clickable_changed', function(){ me.draw(); }),
google.maps.event.addListener(this, 'text_changed', function(){ me.draw(); }),
google.maps.event.addListener(this, 'zindex_changed', function(){ me.draw(); }),
google.maps.event.addDomListener(this.div_, 'click', function(){
if(me.get('clickable')){
google.maps.event.trigger(me, 'click');
}})
];
};
Label.prototype.onRemove=function(){
this.div_.parentNode.removeChild(this.div_);
for (var i=0, I=this.listeners_.length; i < I; ++i){
google.maps.event.removeListener(this.listeners_[i]);
}};
Label.prototype.draw=function(){
var projection=this.getProjection();
var position=projection.fromLatLngToDivPixel(this.get('position'));
var div=this.div_;
div.style.left=position.x + 'px';
div.style.top=position.y + 'px';
var visible=this.get('visible');
div.style.display=visible ? 'block':'none';
var clickable=this.get('clickable');
this.span_.style.cursor=clickable ? 'pointer':'';
var zIndex=this.get('zIndex');
div.style.zIndex=zIndex;
this.span_.innerHTML=this.get('text').toString();
};
function close_adv_search(){
}
/*
function close_adv_search(){
if(!Modernizr.mq('only all and (max-width: 960px)')){
if(mapfunctions_vars.adv_search==='2'||mapfunctions_vars.adv_search===2){
adv_search2=0;
jQuery('#adv-search-2').fadeOut(50,function(){
jQuery('#search_wrapper').animate({
top:112+"px"
},200);
});
jQuery(this).removeClass('adv2_close');
}
if(mapfunctions_vars.adv_search==='4'||mapfunctions_vars.adv_search===4){
adv_search4=0;
jQuery('#adv-search-4').fadeOut(50,function(){
jQuery('#search_wrapper').animate({
top:112+"px"
},200);
});
jQuery(this).addClass('adv4_close');
}}
}
*/
function new_show_advanced_search(){
jQuery("#search_wrapper").removeClass("hidden");
}
function new_hide_advanced_search(){
if(mapfunctions_vars.show_adv_search==='no'){
jQuery("#search_wrapper").addClass("hidden");
}}
function wpestate_hover_action_pin(listing_id){
for (var i=0; i < gmarkers.length; i++){
if(parseInt(gmarkers[i].idul,10)===parseInt(listing_id,10)){
pin_hover_storage=gmarkers[i].icon;
gmarkers[i].setIcon(custompinhover());
}}
}
function wpestate_return_hover_action_pin(listing_id){
for (var i=0; i < gmarkers.length; i++){
if(parseInt(gmarkers[i].idul,10)===parseInt(listing_id,10)){
gmarkers[i].setIcon(pin_hover_storage);
}}
}
function custompinhover(){
"use strict";
var custom_img,image;
custom_img=mapfunctions_vars.path+'/hover.png';
image={
url: custom_img,
size: new google.maps.Size(90, 90),
origin: new google.maps.Point(0,0),
anchor: new google.maps.Point(25,72)
};
return image;
}
function show_pins_filters_from_file(){
"use strict";
if(jQuery("#a_filter_action").length==0){
var action=jQuery('#second_filter_action').attr('data-value');
var category=jQuery('#second_filter_categ').attr('data-value');
var city=jQuery('#second_filter_cities').attr('data-value');
var area=jQuery('#second_filter_areas').attr('data-value');
}else{
var action=jQuery('#a_filter_action').attr('data-value');
var category=jQuery('#a_filter_categ').attr('data-value');
var city=jQuery('#a_filter_cities').attr('data-value');
var area=jQuery('#a_filter_areas').attr('data-value');
}
if(typeof(action)!=='undefined'){
action=action.toLowerCase().trim().replace(" ", "-");
}
if(typeof(action)!=='undefined'){
category=category.toLowerCase().trim().replace(" ", "-");
}
if(typeof(action)!=='undefined'){
city=city.toLowerCase().trim().replace(" ", "-");
}
if(typeof(action)!=='undefined'){
area=area.toLowerCase().trim().replace(" ", "-");
}
if(typeof infoBox!=='undefined'&&infoBox!==null){
infoBox.close();
}
var bounds=new google.maps.LatLngBounds();
if(!isNaN(mcluster)){
mcluster.setIgnoreHidden(true);
}
if(typeof gmarkers!=='undefined'){
for (var i=0; i mz)){
mc.getMap().setZoom(mz + 1);
}}, 100);
}
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}}
});
google.maps.event.addDomListener(this.div_, "mouseover", function (){
var mc=cClusterIcon.cluster_.getMarkerClusterer();
google.maps.event.trigger(mc, "mouseover", cClusterIcon.cluster_);
});
google.maps.event.addDomListener(this.div_, "mouseout", function (){
var mc=cClusterIcon.cluster_.getMarkerClusterer();
google.maps.event.trigger(mc, "mouseout", cClusterIcon.cluster_);
});
};
ClusterIcon.prototype.onRemove=function (){
if(this.div_&&this.div_.parentNode){
this.hide();
google.maps.event.removeListener(this.boundsChangedListener_);
google.maps.event.clearInstanceListeners(this.div_);
this.div_.parentNode.removeChild(this.div_);
this.div_=null;
}};
ClusterIcon.prototype.draw=function (){
if(this.visible_){
var pos=this.getPosFromLatLng_(this.center_);
this.div_.style.top=pos.y + "px";
this.div_.style.left=pos.x + "px";
}};
ClusterIcon.prototype.hide=function (){
if(this.div_){
this.div_.style.display="none";
}
this.visible_=false;
};
ClusterIcon.prototype.show=function (){
if(this.div_){
var img="";
var bp=this.backgroundPosition_.split(" ");
var spriteH=parseInt(bp[0].trim(), 10);
var spriteV=parseInt(bp[1].trim(), 10);
var pos=this.getPosFromLatLng_(this.center_);
this.div_.style.cssText=this.createCss(pos);
img=" ";
this.div_.innerHTML=img + "" + this.sums_.text + "
";
if(typeof this.sums_.title==="undefined"||this.sums_.title===""){
this.div_.title=this.cluster_.getMarkerClusterer().getTitle();
}else{
this.div_.title=this.sums_.title;
}
this.div_.style.display="";
}
this.visible_=true;
};
ClusterIcon.prototype.useStyle=function (sums){
this.sums_=sums;
var index=Math.max(0, sums.index - 1);
index=Math.min(this.styles_.length - 1, index);
var style=this.styles_[index];
this.url_=style.url;
this.height_=style.height;
this.width_=style.width;
this.anchorText_=style.anchorText||[0, 0];
this.anchorIcon_=style.anchorIcon||[parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];
this.textColor_=style.textColor||"black";
this.textSize_=style.textSize||11;
this.textDecoration_=style.textDecoration||"none";
this.fontWeight_=style.fontWeight||"bold";
this.fontStyle_=style.fontStyle||"normal";
this.fontFamily_=style.fontFamily||"Arial,sans-serif";
this.backgroundPosition_=style.backgroundPosition||"0 0";
};
ClusterIcon.prototype.setCenter=function (center){
this.center_=center;
};
ClusterIcon.prototype.createCss=function (pos){
var style=[];
style.push("cursor: pointer;");
style.push("position: absolute; top: " + pos.y + "px; left: " + pos.x + "px;");
style.push("width: " + this.width_ + "px; height: " + this.height_ + "px;");
return style.join("");
};
ClusterIcon.prototype.getPosFromLatLng_=function (latlng){
var pos=this.getProjection().fromLatLngToDivPixel(latlng);
pos.x -=this.anchorIcon_[1];
pos.y -=this.anchorIcon_[0];
pos.x=parseInt(pos.x, 10);
pos.y=parseInt(pos.y, 10);
return pos;
};
function Cluster(mc){
this.markerClusterer_=mc;
this.map_=mc.getMap();
this.gridSize_=mc.getGridSize();
this.minClusterSize_=mc.getMinimumClusterSize();
this.averageCenter_=mc.getAverageCenter();
this.markers_=[];
this.center_=null;
this.bounds_=null;
this.clusterIcon_=new ClusterIcon(this, mc.getStyles());
}
Cluster.prototype.getSize=function (){
return this.markers_.length;
};
Cluster.prototype.getMarkers=function (){
return this.markers_;
};
Cluster.prototype.getCenter=function (){
return this.center_;
};
Cluster.prototype.getMap=function (){
return this.map_;
};
Cluster.prototype.getMarkerClusterer=function (){
return this.markerClusterer_;
};
Cluster.prototype.getBounds=function (){
var i;
var bounds=new google.maps.LatLngBounds(this.center_, this.center_);
var markers=this.getMarkers();
for (i=0; i < markers.length; i++){
bounds.extend(markers[i].getPosition());
}
return bounds;
};
Cluster.prototype.remove=function (){
this.clusterIcon_.setMap(null);
this.markers_=[];
delete this.markers_;
};
Cluster.prototype.addMarker=function (marker){
var i;
var mCount;
var mz;
if(this.isMarkerAlreadyAdded_(marker)){
return false;
}
if(!this.center_){
this.center_=marker.getPosition();
this.calculateBounds_();
}else{
if(this.averageCenter_){
var l=this.markers_.length + 1;
var lat=(this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;
var lng=(this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;
this.center_=new google.maps.LatLng(lat, lng);
this.calculateBounds_();
}}
marker.isAdded=true;
this.markers_.push(marker);
mCount=this.markers_.length;
mz=this.markerClusterer_.getMaxZoom();
if(mz!==null&&this.map_.getZoom() > mz){
if(marker.getMap()!==this.map_){
marker.setMap(this.map_);
}}else if(mCount < this.minClusterSize_){
if(marker.getMap()!==this.map_){
marker.setMap(this.map_);
}}else if(mCount===this.minClusterSize_){
for (i=0; i < mCount; i++){
this.markers_[i].setMap(null);
}}else{
marker.setMap(null);
}
this.updateIcon_();
return true;
};
Cluster.prototype.isMarkerInClusterBounds=function (marker){
return this.bounds_.contains(marker.getPosition());
};
Cluster.prototype.calculateBounds_=function (){
var bounds=new google.maps.LatLngBounds(this.center_, this.center_);
this.bounds_=this.markerClusterer_.getExtendedBounds(bounds);
};
Cluster.prototype.updateIcon_=function (){
var mCount=this.markers_.length;
var mz=this.markerClusterer_.getMaxZoom();
if(mz!==null&&this.map_.getZoom() > mz){
this.clusterIcon_.hide();
return;
}
if(mCount < this.minClusterSize_){
this.clusterIcon_.hide();
return;
}
var numStyles=this.markerClusterer_.getStyles().length;
var sums=this.markerClusterer_.getCalculator()(this.markers_, numStyles);
this.clusterIcon_.setCenter(this.center_);
this.clusterIcon_.useStyle(sums);
this.clusterIcon_.show();
};
Cluster.prototype.isMarkerAlreadyAdded_=function (marker){
var i;
if(this.markers_.indexOf){
return this.markers_.indexOf(marker)!==-1;
}else{
for (i=0; i < this.markers_.length; i++){
if(marker===this.markers_[i]){
return true;
}}
}
return false;
};
function MarkerClusterer(map, opt_markers, opt_options){
this.extend(MarkerClusterer, google.maps.OverlayView);
opt_markers=opt_markers||[];
opt_options=opt_options||{};
this.markers_=[];
this.clusters_=[];
this.listeners_=[];
this.activeMap_=null;
this.ready_=false;
this.gridSize_=opt_options.gridSize||60;
this.minClusterSize_=opt_options.minimumClusterSize||2;
this.maxZoom_=opt_options.maxZoom||null;
this.styles_=opt_options.styles||[];
this.title_=opt_options.title||"";
this.zoomOnClick_=true;
if(opt_options.zoomOnClick!==undefined){
this.zoomOnClick_=opt_options.zoomOnClick;
}
this.averageCenter_=false;
if(opt_options.averageCenter!==undefined){
this.averageCenter_=opt_options.averageCenter;
}
this.ignoreHidden_=false;
if(opt_options.ignoreHidden!==undefined){
this.ignoreHidden_=opt_options.ignoreHidden;
}
this.enableRetinaIcons_=false;
if(opt_options.enableRetinaIcons!==undefined){
this.enableRetinaIcons_=opt_options.enableRetinaIcons;
}
this.imagePath_=opt_options.imagePath||MarkerClusterer.IMAGE_PATH;
this.imageExtension_=opt_options.imageExtension||MarkerClusterer.IMAGE_EXTENSION;
this.imageSizes_=opt_options.imageSizes||MarkerClusterer.IMAGE_SIZES;
this.calculator_=opt_options.calculator||MarkerClusterer.CALCULATOR;
this.batchSize_=opt_options.batchSize||MarkerClusterer.BATCH_SIZE;
this.batchSizeIE_=opt_options.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE;
this.clusterClass_=opt_options.clusterClass||"cluster";
if(navigator.userAgent.toLowerCase().indexOf("msie")!==-1){
this.batchSize_=this.batchSizeIE_;
}
this.setupStyles_();
this.addMarkers(opt_markers, true);
this.setMap(map);
}
MarkerClusterer.prototype.onAdd=function (){
var cMarkerClusterer=this;
this.activeMap_=this.getMap();
this.ready_=true;
this.repaint();
this.listeners_=[
google.maps.event.addListener(this.getMap(), "zoom_changed", function (){
cMarkerClusterer.resetViewport_(false);
if(this.getZoom()===(this.get("minZoom")||0)||this.getZoom()===this.get("maxZoom")){
google.maps.event.trigger(this, "idle");
}}),
google.maps.event.addListener(this.getMap(), "idle", function (){
cMarkerClusterer.redraw_();
})
];
};
MarkerClusterer.prototype.onRemove=function (){
var i;
for (i=0; i < this.markers_.length; i++){
if(this.markers_[i].getMap()!==this.activeMap_){
this.markers_[i].setMap(this.activeMap_);
}}
for (i=0; i < this.clusters_.length; i++){
this.clusters_[i].remove();
}
this.clusters_=[];
for (i=0; i < this.listeners_.length; i++){
google.maps.event.removeListener(this.listeners_[i]);
}
this.listeners_=[];
this.activeMap_=null;
this.ready_=false;
};
MarkerClusterer.prototype.draw=function (){};
MarkerClusterer.prototype.setupStyles_=function (){
var i, size;
if(this.styles_.length > 0){
return;
}
for (i=0; i < this.imageSizes_.length; i++){
size=this.imageSizes_[i];
this.styles_.push({
url: this.imagePath_ + (i + 1) + "." + this.imageExtension_,
height: size,
width: size
});
}};
MarkerClusterer.prototype.fitMapToMarkers=function (){
var i;
var markers=this.getMarkers();
var bounds=new google.maps.LatLngBounds();
for (i=0; i < markers.length; i++){
bounds.extend(markers[i].getPosition());
}
this.getMap().fitBounds(bounds);
};
MarkerClusterer.prototype.getGridSize=function (){
return this.gridSize_;
};
MarkerClusterer.prototype.setGridSize=function (gridSize){
this.gridSize_=gridSize;
};
MarkerClusterer.prototype.getMinimumClusterSize=function (){
return this.minClusterSize_;
};
MarkerClusterer.prototype.setMinimumClusterSize=function (minimumClusterSize){
this.minClusterSize_=minimumClusterSize;
};
MarkerClusterer.prototype.getMaxZoom=function (){
return this.maxZoom_;
};
MarkerClusterer.prototype.setMaxZoom=function (maxZoom){
this.maxZoom_=maxZoom;
};
MarkerClusterer.prototype.getStyles=function (){
return this.styles_;
};
MarkerClusterer.prototype.setStyles=function (styles){
this.styles_=styles;
};
MarkerClusterer.prototype.getTitle=function (){
return this.title_;
};
MarkerClusterer.prototype.setTitle=function (title){
this.title_=title;
};
MarkerClusterer.prototype.getZoomOnClick=function (){
return this.zoomOnClick_;
};
MarkerClusterer.prototype.setZoomOnClick=function (zoomOnClick){
this.zoomOnClick_=zoomOnClick;
};
MarkerClusterer.prototype.getAverageCenter=function (){
return this.averageCenter_;
};
MarkerClusterer.prototype.setAverageCenter=function (averageCenter){
this.averageCenter_=averageCenter;
};
MarkerClusterer.prototype.getIgnoreHidden=function (){
return this.ignoreHidden_;
};
MarkerClusterer.prototype.setIgnoreHidden=function (ignoreHidden){
this.ignoreHidden_=ignoreHidden;
};
MarkerClusterer.prototype.getEnableRetinaIcons=function (){
return this.enableRetinaIcons_;
};
MarkerClusterer.prototype.setEnableRetinaIcons=function (enableRetinaIcons){
this.enableRetinaIcons_=enableRetinaIcons;
};
MarkerClusterer.prototype.getImageExtension=function (){
return this.imageExtension_;
};
MarkerClusterer.prototype.setImageExtension=function (imageExtension){
this.imageExtension_=imageExtension;
};
MarkerClusterer.prototype.getImagePath=function (){
return this.imagePath_;
};
MarkerClusterer.prototype.setImagePath=function (imagePath){
this.imagePath_=imagePath;
};
MarkerClusterer.prototype.getImageSizes=function (){
return this.imageSizes_;
};
MarkerClusterer.prototype.setImageSizes=function (imageSizes){
this.imageSizes_=imageSizes;
};
MarkerClusterer.prototype.getCalculator=function (){
return this.calculator_;
};
/**
* Sets the value of the calculator
property.
*
* @param {function(Array., number)} calculator The value
* of the calculator property.
*/
MarkerClusterer.prototype.setCalculator=function (calculator){
this.calculator_=calculator;
};
MarkerClusterer.prototype.getBatchSizeIE=function (){
return this.batchSizeIE_;
};
MarkerClusterer.prototype.setBatchSizeIE=function (batchSizeIE){
this.batchSizeIE_=batchSizeIE;
};
MarkerClusterer.prototype.getClusterClass=function (){
return this.clusterClass_;
};
MarkerClusterer.prototype.setClusterClass=function (clusterClass){
this.clusterClass_=clusterClass;
};
MarkerClusterer.prototype.getMarkers=function (){
return this.markers_;
};
MarkerClusterer.prototype.getTotalMarkers=function (){
return this.markers_.length;
};
MarkerClusterer.prototype.getClusters=function (){
return this.clusters_;
};
MarkerClusterer.prototype.getTotalClusters=function (){
return this.clusters_.length;
};
MarkerClusterer.prototype.addMarker=function (marker, opt_nodraw){
this.pushMarkerTo_(marker);
if(!opt_nodraw){
this.redraw_();
}};
MarkerClusterer.prototype.addMarkers=function (markers, opt_nodraw){
var key;
for (key in markers){
if(markers.hasOwnProperty(key)){
this.pushMarkerTo_(markers[key]);
}}
if(!opt_nodraw){
this.redraw_();
}};
MarkerClusterer.prototype.pushMarkerTo_=function (marker){
if(marker.getDraggable()){
var cMarkerClusterer=this;
google.maps.event.addListener(marker, "dragend", function (){
if(cMarkerClusterer.ready_){
this.isAdded=false;
cMarkerClusterer.repaint();
}});
}
marker.isAdded=false;
this.markers_.push(marker);
};
MarkerClusterer.prototype.removeMarker=function (marker, opt_nodraw){
var removed=this.removeMarker_(marker);
if(!opt_nodraw&&removed){
this.repaint();
}
return removed;
};
MarkerClusterer.prototype.removeMarkers=function (markers, opt_nodraw){
var i, r;
var removed=false;
for (i=0; i < markers.length; i++){
r=this.removeMarker_(markers[i]);
removed=removed||r;
}
if(!opt_nodraw&&removed){
this.repaint();
}
return removed;
};
MarkerClusterer.prototype.removeMarker_=function (marker){
var i;
var index=-1;
if(this.markers_.indexOf){
index=this.markers_.indexOf(marker);
}else{
for (i=0; i < this.markers_.length; i++){
if(marker===this.markers_[i]){
index=i;
break;
}}
}
if(index===-1){
return false;
}
marker.setMap(null);
this.markers_.splice(index, 1);
return true;
};
MarkerClusterer.prototype.clearMarkers=function (){
this.resetViewport_(true);
this.markers_=[];
};
MarkerClusterer.prototype.repaint=function (){
var oldClusters=this.clusters_.slice();
this.clusters_=[];
this.resetViewport_(false);
this.redraw_();
setTimeout(function (){
var i;
for (i=0; i < oldClusters.length; i++){
oldClusters[i].remove();
}}, 0);
};
MarkerClusterer.prototype.getExtendedBounds=function (bounds){
var projection=this.getProjection();
var tr=new google.maps.LatLng(bounds.getNorthEast().lat(),
bounds.getNorthEast().lng());
var bl=new google.maps.LatLng(bounds.getSouthWest().lat(),
bounds.getSouthWest().lng());
var trPix=projection.fromLatLngToDivPixel(tr);
trPix.x +=this.gridSize_;
trPix.y -=this.gridSize_;
var blPix=projection.fromLatLngToDivPixel(bl);
blPix.x -=this.gridSize_;
blPix.y +=this.gridSize_;
var ne=projection.fromDivPixelToLatLng(trPix);
var sw=projection.fromDivPixelToLatLng(blPix);
bounds.extend(ne);
bounds.extend(sw);
return bounds;
};
MarkerClusterer.prototype.redraw_=function (){
this.createClusters_(0);
};
MarkerClusterer.prototype.resetViewport_=function (opt_hide){
var i, marker;
for (i=0; i < this.clusters_.length; i++){
this.clusters_[i].remove();
}
this.clusters_=[];
for (i=0; i < this.markers_.length; i++){
marker=this.markers_[i];
marker.isAdded=false;
if(opt_hide){
marker.setMap(null);
}}
};
MarkerClusterer.prototype.distanceBetweenPoints_=function (p1, p2){
var R=6371;
var dLat=(p2.lat() - p1.lat()) * Math.PI / 180;
var dLon=(p2.lng() - p1.lng()) * Math.PI / 180;
var a=Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c=2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d=R * c;
return d;
};
MarkerClusterer.prototype.isMarkerInBounds_=function (marker, bounds){
return bounds.contains(marker.getPosition());
};
MarkerClusterer.prototype.addToClosestCluster_=function (marker){
var i, d, cluster, center;
var distance=40000;
var clusterToAddTo=null;
for (i=0; i < this.clusters_.length; i++){
cluster=this.clusters_[i];
center=cluster.getCenter();
if(center){
d=this.distanceBetweenPoints_(center, marker.getPosition());
if(d < distance){
distance=d;
clusterToAddTo=cluster;
}}
}
if(clusterToAddTo&&clusterToAddTo.isMarkerInClusterBounds(marker)){
clusterToAddTo.addMarker(marker);
}else{
cluster=new Cluster(this);
cluster.addMarker(marker);
this.clusters_.push(cluster);
}};
MarkerClusterer.prototype.createClusters_=function (iFirst){
var i, marker;
var mapBounds;
var cMarkerClusterer=this;
if(!this.ready_){
return;
}
if(iFirst===0){
google.maps.event.trigger(this, "clusteringbegin", this);
if(typeof this.timerRefStatic!=="undefined"){
clearTimeout(this.timerRefStatic);
delete this.timerRefStatic;
}}
if(this.getMap().getZoom() > 3){
mapBounds=new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),
this.getMap().getBounds().getNorthEast());
}else{
mapBounds=new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
}
var bounds=this.getExtendedBounds(mapBounds);
var iLast=Math.min(iFirst + this.batchSize_, this.markers_.length);
for (i=iFirst; i < iLast; i++){
marker=this.markers_[i];
if(!marker.isAdded&&this.isMarkerInBounds_(marker, bounds)){
if(!this.ignoreHidden_||(this.ignoreHidden_&&marker.getVisible())){
this.addToClosestCluster_(marker);
}}
}
if(iLast < this.markers_.length){
this.timerRefStatic=setTimeout(function (){
cMarkerClusterer.createClusters_(iLast);
}, 0);
}else{
delete this.timerRefStatic;
google.maps.event.trigger(this, "clusteringend", this);
}};
MarkerClusterer.prototype.extend=function (obj1, obj2){
return (function (object){
var property;
for (property in object.prototype){
this.prototype[property]=object.prototype[property];
}
return this;
}).apply(obj1, [obj2]);
};
MarkerClusterer.CALCULATOR=function (markers, numStyles){
var index=0;
var title="";
var count=markers.length.toString();
var dv=count;
while (dv!==0){
dv=parseInt(dv / 10, 10);
index++;
}
index=Math.min(index, numStyles);
return {
text: count,
index: index,
title: title
};};
MarkerClusterer.BATCH_SIZE=2000;
MarkerClusterer.BATCH_SIZE_IE=500;
MarkerClusterer.IMAGE_PATH="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m";
MarkerClusterer.IMAGE_EXTENSION="png";
MarkerClusterer.IMAGE_SIZES=[53, 56, 66, 78, 90];
if(typeof String.prototype.trim!=='function'){
String.prototype.trim=function(){
return this.replace(/^\s+|\s+$/g, '');
}};
(function(){
var h=!0,u=null,v=!1;
(function(){var A,B={}.hasOwnProperty,C=[].slice;if(((A=this.google)!=u?A.maps:void 0)!=u)this.OverlappingMarkerSpiderfier=function(){function w(b,d){var a,g,f,e,c=this;this.map=b;d==u&&(d={});for(a in d)B.call(d,a)&&(g=d[a],this[a]=g);this.e=new this.constructor.g(this.map);this.n();this.b={};e=["click","zoom_changed","maptypeid_changed"];g=0;for(f=e.length;gd)return this;g=this.j.splice(d,1)[0];f=0;for(e=g.length;fa||this.b[b].splice(a,1);return this};c.clearListeners=function(b){this.b[b]=[];return this};c.trigger=function(){var b,d,a,g,f,e;d=arguments[0];b=2<=arguments.length?C.call(arguments,1):[];d=(a=this.b[d])!=u?a:[];e=[];g=0;for(f=d.length;gb;a=0<=b?++e:--e)a=this.circleStartAngle+a*g,c.push(new s.Point(d.x+f*Math.cos(a),d.y+f*Math.sin(a)));return c};c.v=function(b,d){var a,g,f,e,c;f=this.spiralLengthStart;a=0;c=[];for(g=e=0;0<=b?eb;g=0<=b?++e:--e)a+=this.spiralFootSeparation/f+5E-4*g,g=new s.Point(d.x+f*Math.cos(a),d.y+f*Math.sin(a)),f+=y*this.spiralLengthFactor/a,c.push(g);return c};c.F=function(b,d){var a,g,f,e,c,
m,l,x,n;e=b._omsData!=u;(!e||!this.keepSpiderfied)&&this.unspiderfy();if(e||this.map.getStreetView().getVisible()||"GoogleEarthAPI"===this.map.getMapTypeId())return this.trigger("click",b,d);e=[];c=[];a=this.nearbyDistance;m=a*a;f=this.c(b.position);n=this.a;l=0;for(x=n.length;l=this.circleSpiralSwitchover?this.v(q,a).reverse():this.u(q,a);a=function(){var a,d,k,q=this;k=[];a=0;for(d=e.length;a 0 ? '\\.':'$') + ')';
return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&'+control_vars.price_separator);
};
jQuery(document).ready(function ($){
"use strict";
var screen_width,screen_height;
$('.list_sidebar_currency li').click(function(){
var ajaxurl,data,pos,symbol,coef,curpos;
data=$(this).attr('data-value');
pos=$(this).attr('data-pos');
symbol=$(this).attr('data-symbol');
coef=$(this).attr('data-coef');
curpos=$(this).attr('data-curpos');
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_set_cookie_multiple_curr',
'curr':data,
'pos':pos,
'symbol':symbol,
'coef':coef,
'curpos':curpos,
},
success: function (data){
location.reload();
},
error: function (errorThrown){}});
});
$('#map-view').click(function(event){
$('.map-type').fadeIn(400);
});
$('.map-type').click(function(){
var map_type;
$('.map-type').hide();
map_type=$(this).attr('id');
});
if(typeof enable_half_map_pin_action=='function'){
enable_half_map_pin_action();
}
$('#pack_select').change(function(){
var stripe_pack_id,stripe_ammount,the_pick;
$("#pack_select option:selected").each(function(){
stripe_pack_id=$(this).val();
stripe_ammount=parseFloat($(this).attr('data-price'))*100;
the_pick=$(this).attr('data-pick');
});
$('#pack_id').val(stripe_pack_id);
$('#pay_ammout').val(stripe_ammount);
$('#stripe_form').attr('data-amount',stripe_ammount);
$('.stripe_buttons').each(function(){
$(this).hide();
if($(this).attr('id')===the_pick){
$(this).show();
}})
});
$('#pack_recuring').click(function (){
if($(this).attr('checked')){
$('#stripe_form').append(' ');
}else{
$('#stripe_recuring').remove();
}});
$('.front_plan_row').click(function(event){
event.preventDefault();
$('.front_plan_row_image').slideUp();
$(this).next().slideDown();
})
$('.deleter_floor').click(function(){
$(this).parent().remove();
})
$('#adv_extended_options_text_adv ').click(function(){
$('.adv-search-1.adv_extended_class').css('height','auto');
$('.adv_extended_class .adv1-holder').css('height','auto');
$(this).parent().find('.adv_extended_options_text').hide();
$(this).parent().find('.extended_search_check_wrapper').slideDown();
$(this).parent().find('#adv_extended_close_adv').show();
});
$('#adv_extended_close_adv').click(function(){
$(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
$(this).hide();
$(this).parent().parent().find('.adv_extended_options_text').show();
$('.adv-search-1.adv_extended_class').removeAttr('style');
$('.adv_extended_class .adv1-holder').removeAttr('style');
});
$('#adv_extended_options_text_widget').click(function(){
$(this).parent().find('.adv_extended_options_text').hide();
$(this).parent().find('.extended_search_check_wrapper').slideDown();
$(this).parent().find('#adv_extended_close_widget').show();
});
$('#adv_extended_close_widget').click(function(){
$(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
$(this).hide();
$(this).parent().parent().find('.adv_extended_options_text').show();
});
$('#adv_extended_options_text_short').click(function(){
$(this).parent().find('.adv_extended_options_text').hide();
$(this).parent().find('.extended_search_check_wrapper').slideDown();
$(this).parent().find('#adv_extended_close_short').show();
});
$('#adv_extended_close_short').click(function(){
$(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
$(this).hide();
$(this).parent().parent().find('.adv_extended_options_text').show();
});
$('#adv_extended_options_text_mobile').click(function(){
$(this).parent().find('.adv_extended_options_text').hide();
$(this).parent().find('.extended_search_check_wrapper').slideDown();
$(this).parent().find('#adv_extended_close_mobile').show();
});
$('#adv_extended_close_mobile').click(function(){
$(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
$(this).hide();
$(this).parent().parent().find('.adv_extended_options_text').show();
});
$('.nav-prev,.nav-next ').click(function(event){
event.preventDefault();
var link=$(this).find('a').attr('href');
window.open (link,'_self',false)
})
$('.featured_agent_details_wrapper, .agent-listing-img-wrapper').click(function(){
var newl=$(this).attr('data-link');
window.open (newl,'_self',false)
});
$('.see_my_list_featured').click(function(event){
event.stopPropagation();
});
$('.featured_cover').click(function(){
var newl=$(this).attr('data-link');
window.open (newl,'_self',false)
});
$('.agent_face').hover(function(){
$(this).find('.agent_face_details').fadeIn('500')
}, function(){
$(this).find('.agent_face_details').fadeOut('500')
}
);
$('.property_listing, .agent_unit, .blog_unit , .featured_widget_image').click(function(){
var link;
link=$(this).attr('data-link');
window.open(link, '_self');
});
$('.share_unit').click(function(event){
event.stopPropagation();
});
$('.related_blog_unit_image').click(function(){
var link;
link=$(this).attr('data-related-link');
window.open(link, '_self');
});
$('#user_menu_u').click(function(event){
if($('#user_menu_open').is(":visible")){
$('#user_menu_open').removeClass('iosfixed').fadeOut(400);
}else{
$('#user_menu_open').fadeIn(400);
}
event.stopPropagation();
});
$(document).click(function(event){
var clicka=event.target.id
if(!$('#'+clicka).parents('.topmenux').length){
$('#user_menu_open').removeClass('iosfixed').hide(400);
}});
jQuery('#imagelist i.fa-trash-o').click(function(){
var curent='';
jQuery(this).parent().remove();
jQuery('#imagelist .uploaded_images').each(function(){
curent=curent+','+jQuery(this).attr('data-imageid');
});
jQuery('#attachid').val(curent);
});
jQuery('#imagelist img').dblclick(function(){
jQuery('#imagelist .uploaded_images .thumber').each(function(){
jQuery(this).remove();
});
jQuery(this).parent().append(' ')
jQuery('#attachthumb').val(jQuery(this).parent().attr('data-imageid'));
});
$('#switch').click(function (){
$('.main_wrapper').toggleClass('wide');
});
$('#accordion_prop_addr, #accordion_prop_details, #accordion_prop_features').on('shown.bs.collapse', function (){
$(this).find('h4').removeClass('carusel_closed');
})
$('#accordion_prop_addr, #accordion_prop_details, #accordion_prop_features').on('hidden.bs.collapse', function (){
$(this).find('h4').addClass('carusel_closed');
})
var elems=['#adv-search-3', '#adv-search-1', '#advanced_search_shortcode', '#adv-search-2', '#advanced_search_shortcode_2', '.adv-search-mobile','.advanced_search_sidebar'];
$.each(elems, function(i, elem){
$(elem+' li').click(function (event){
event.preventDefault();
var pick, value, parent,parent_replace;
parent_replace='.filter_menu_trigger';
if(elem==='.advanced_search_sidebar'){
parent_replace='.sidebar_filter_menu';
}
pick=$(this).text();
value=$(this).attr('data-value');
parent=$(this).parent().parent();
parent.find(parent_replace).text(pick).append(' ').attr('data-value',value);
parent.find('input').val(value);
});
});
jQuery('#adv-search-1 li, #adv-search-3 li, .halfsearch input[type="checkbox"]').click(function (){
if(typeof (show_pins)!=="undefined"){
first_time_wpestate_show_inpage_ajax_half=1
show_pins();
}});
jQuery('#adv_rooms, #adv_bath, #price_low, #price_max, #adv-search-1 input[type=text], #adv-search-3 input[type=text]').change(function (){
if(typeof (show_pins)!=="undefined"){
first_time_wpestate_show_inpage_ajax_half=1
show_pins();
}});
function isFunction(possibleFunction){
return typeof(possibleFunction)===typeof(Function);
}
$('#showinpage,#showinpage_mobile').click(function (event){
event.preventDefault();
wpestate_show_inpage_ajax();
});
function wpestate_show_inpage_ajax(){
if($('#gmap-full').hasClass('spanselected')){
$('#gmap-full').trigger('click');
}
if(mapfunctions_vars.custom_search==='yes'){
custom_search_start_filtering_ajax(1);
}else{
start_filtering_ajax(1);
}}
$('#openmap').click(function(){
if($(this).find('i').hasClass('fa-angle-down')){
$(this).empty().append(' '+control_vars.close_map);
if(control_vars.show_adv_search_map_close==='no'){
$('.search_wrapper').addClass('adv1_close');
adv_search_click();
}}else{
$(this).empty().append(' '+control_vars.open_map);
}
new_open_close_map(2);
});
var wrap_h;
var map_h;
$('#gmap-full').click(function(){
if($('#gmap_wrapper').hasClass('fullmap')){
$('#google_map_prop_list_wrapper').removeClass('fullhalf');
$('#gmap_wrapper').removeClass('fullmap').css('height',wrap_h+'px');
$('#googleMap').removeClass('fullmap').css('height',map_h+'px');
$('#search_wrapper').removeClass('fullscreen_search');
$('#search_wrapper').removeClass('fullscreen_search_open');
$('.nav_wrapper').removeClass('hidden');
if(!$('#google_map_prop_list_wrapper').length){
$('.content_wrapper').show();
}
$('body,html').animate({
scrollTop: 0
}, "slow");
$('#openmap').show();
$(this).empty().append(' '+control_vars.fullscreen).removeClass('spanselected');
$('#google_map_prop_list_wrapper').removeClass('fullscreen');
$('#google_map_prop_list_sidebar').removeClass('fullscreen');
}else{
$('#google_map_prop_list_wrapper').addClass('fullscreen');
$('#google_map_prop_list_sidebar').addClass('fullscreen');
$('#google_map_prop_list_wrapper').addClass('fullhalf');
wrap_h=$('#gmap_wrapper').outerHeight();
map_h=$('#googleMap').outerHeight();
$('#gmap_wrapper,#googleMap').css('height','100%').addClass('fullmap');
$('#search_wrapper').addClass('fullscreen_search');
$('.nav_wrapper').addClass('hidden');
if(!$('#google_map_prop_list_wrapper').length){
$('.content_wrapper').hide();
}
$('#openmap').hide();
$(this).empty().append(' '+control_vars.default).addClass('spanselected');
}
google.maps.event.trigger(map, "resize");
});
$('#street-view').click(function(){
toggleStreetView();
});
$('#slider_enable_map').click(function(){
var cur_lat, cur_long, myLatLng;
$('#carousel-listing div').removeClass('slideron');
$('.vertical-wrapper,.verticalstatus ').hide();
$(this).addClass('slideron');
$('#googleMapSlider').show();
google.maps.event.trigger(map, "resize");
map.setOptions({draggable: true});
cur_lat=jQuery('#googleMapSlider').attr('data-cur_lat');
cur_long=jQuery('#googleMapSlider').attr('data-cur_long');
myLatLng=new google.maps.LatLng(cur_lat,cur_long);
map.setCenter(myLatLng);
map.panBy(10,-100);
panorama.setVisible(false);
$('#gmapzoomminus.smallslidecontrol').show();
$('#gmapzoomplus.smallslidecontrol').show();
});
$('#slider_enable_street').click(function(){
var cur_lat, cur_long, myLatLng;
$('#carousel-listing div').removeClass('slideron');
$('.vertical-wrapper,.verticalstatus ').hide();
$(this).addClass('slideron');
cur_lat=jQuery('#googleMapSlider').attr('data-cur_lat');
cur_long=jQuery('#googleMapSlider').attr('data-cur_long');
myLatLng=new google.maps.LatLng(cur_lat,cur_long);
$('#googleMapSlider').show();
panorama.setPosition(myLatLng);
panorama.setVisible(true);
$('#gmapzoomminus.smallslidecontrol').hide();
$('#gmapzoomplus.smallslidecontrol').hide();
});
$('#slider_enable_slider').click(function(){
$('#carousel-listing div').removeClass('slideron');
$(this).addClass('slideron');
$('.vertical-wrapper,.verticalstatus ').show();
$('#googleMapSlider').hide();
panorama.setVisible(false);
$('#gmapzoomminus.smallslidecontrol').hide();
$('#gmapzoomplus.smallslidecontrol').hide();
});
$('.caption-wrapper').click(function(){
$(this).toggleClass('closed');
$('.carusel-back').toggleClass('rowclosed');
$('.post-carusel .carousel-indicators').toggleClass('rowclosed');
});
$('#carousel-listing').on('slid.bs.carousel', function (){
if($(this).hasClass('carouselvertical')){
show_capture_vertical();
}else{
show_capture();
}
$('#carousel-listing div').removeClass('slideron');
$('#slider_enable_slider').addClass('slideron');
})
$('.carousel-round-indicators li').click(function(){
$('.carousel-round-indicators li').removeClass('active');
$(this).addClass('active');
});
$('.videoitem iframe').click(function(){
$('.estate_video_control').remove();
});
adv_search_click();
$('#adv-search-header-1').click(function(){
if(document.getElementById("adv_extended_options_text_adv")!==null){
$(this).parent().toggleClass('adv-search-1-close-extended');
}else{
$(this).parent().toggleClass('adv-search-1-close');
}});
$('#adv-search-header-3').click(function(){
$(this).parent().parent().toggleClass(' search_wrapper-close-extended');
});
$(".share_list, .icon-fav, .compare-action, .dashboad-tooltip").hover(function(){
$(this).tooltip('show') ;
}, function(){
$(this).tooltip('hide');
}
);
$('.share_list').click(function(event){
event.stopPropagation();
var sharediv=$(this).parent().find('.share_unit');
sharediv.toggle();
$(this).toggleClass('share_on');
})
$('.backtop').click(function(event){
event.preventDefault();
$('body,html').animate({
scrollTop: 0
}, "slow");
})
$('.contact-box ').click(function(event){
event.preventDefault();
$('.contactformwrapper').toggleClass('hidden');
contact_footer_starter();
});
$('#morg_compute').click(function(){
var intPayPer=0;
var intMthPay=0;
var intMthInt=0;
var intPerFin=0;
var intAmtFin=0;
var intIntRate=0;
var intAnnCost=0;
var intVal=0;
var salePrice=0;
salePrice=$('#sale_price').val();
intPerFin=$('#percent_down').val() / 100;
intAmtFin=salePrice - salePrice * intPerFin;
intPayPer=parseInt ($('#term_years').val(),10) * 12;
intIntRate=parseFloat ($('#interest_rate').val(),10);
intMthInt=intIntRate / (12 * 100);
intVal=raisePower(1 + intMthInt, -intPayPer);
intMthPay=intAmtFin * (intMthInt / (1 - intVal));
intAnnCost=intMthPay * 12;
$('#am_fin').html(""+control_vars.morg1+" " + (Math.round(intAmtFin * 100)) / 100 + " ");
$('#morgage_pay').html(""+control_vars.morg2+" " + (Math.round(intMthPay * 100)) / 100 + " ");
$('#anual_pay').html(""+control_vars.morg3+" " + (Math.round(intAnnCost * 100)) / 100 + " ");
$('#morg_results').show();
$('.mortgage_calculator_div').css('height',532+'px');
});
$("#geolocation-button").hover(function (){
$('#tooltip-geolocation').fadeIn();
$('.tooltip').fadeOut("fast");
},
function (){
$('#tooltip-geolocation').fadeOut();
}
);
$('.extra_featured').change(function(){
var parent=$(this).parent();
var price_regular=parseFloat(parent.find('.submit-price-no').text(),10);
var price_featured=parseFloat(parent.find('.submit-price-featured').text(),10);
var total=price_regular+price_featured;
if($(this).is(':checked')){
parent.find('.submit-price-total').text(total);
parent.find('#stripe_form_featured').show();
parent.find('#stripe_form_simple').hide();
}else{
parent.find('.submit-price-total').text(price_regular);
parent.find('#stripe_form_featured').hide();
parent.find('#stripe_form_simple').show();
}});
$('.compare_wrapper').each(function(){
var cols=$(this).find('.compare_item_head').length;
$(this).addClass('compar-' + cols);
});
$('#list_view').click(function(){
$(this).toggleClass('icon_selected');
$('#listing_ajax_container').addClass('ajax12');
$('#grid_view').toggleClass('icon_selected');
$('.listing_wrapper').hide().removeClass('col-md-4').removeClass('col-md-3').addClass('col-md-12').fadeIn(400) ;
$('.the_grid_view').fadeOut(10,function(){
$('.the_list_view').fadeIn(300);
});
})
$('#grid_view').click(function(){
var class_type;
class_type=$('.listing_wrapper:first-of-type').attr('data-org');
$(this).toggleClass('icon_selected');
$('#listing_ajax_container').removeClass('ajax12');
$('#list_view').toggleClass('icon_selected');
$('.listing_wrapper ').hide().removeClass('col-md-12').addClass('col-md-'+class_type).fadeIn(400);
$('.the_list_view').fadeOut(10,function(){
$('.the_grid_view').fadeIn(300);
});
})
var already_in=[];
$('.compare-action').click(function(e){
e.preventDefault();
e.stopPropagation();
$('.prop-compare').show();
var post_id=$(this).attr('data-pid');
for(var i=0; i < already_in.length; i++){
if(already_in[i]===post_id){
return;
}}
already_in.push(post_id);
var post_image=$(this).attr('data-pimage');
var to_add='';
$('div.items_compare:first-child').css('background', 'red');
if(parseInt($('.items_compare').length,10) > 3){
$('.items_compare:first').remove();
}
$('#submit_compare').before(to_add);
$('#submit_compare').click(function(){
$('#form_compare').trigger('submit');
})
$('.items_compare').fadeIn(500);
});
$('#submit_compare').click(function(){
$('#form_compare').trigger('submit');
})
$('#form_submit_2,#form_submit_1 ').click(function(){
var loading_modal;
window.scrollTo(0, 0);
loading_modal=' ';
jQuery('body').append(loading_modal);
jQuery('#loadingmodal').modal();
});
$('#add-new-image').click(function(){
$('
').appendTo('#files_area');
})
$('.delete_image').click(function(){
var image_id=$(this).attr('data-imageid');
var curent=$('#images_todelete').val();
if(curent===''){
curent=image_id;
}else{
curent=curent+','+image_id;
}
$('#images_todelete').val(curent) ;
$(this).parent().remove();
});
$('#googleMap').bind('mousemove', function(e){
$('.tooltip').css({'top':e.pageY,'left':e.pageX, 'z-index':'1'});
});
setTimeout(function(){ $('.tooltip').fadeOut("fast");},10000);
});
function wpestate_filter_city_area(selected_city,selected_area){
jQuery('#'+selected_city+' li').click(function(event){
event.preventDefault();
var pick, value_city, parent, selected_city, is_city, area_value;
value_city=String(jQuery(this).attr('data-value2')).toLowerCase();
jQuery('#'+selected_area+' li').each(function(){
is_city=String(jQuery(this).attr('data-parentcity')).toLowerCase();
is_city=is_city.replace(" ","-");
area_value=String(jQuery(this).attr('data-value')).toLowerCase();
if(is_city===value_city||value_city==='all'){
jQuery(this).show();
}else{
jQuery(this).hide();
}});
});
}
function show_capture_vertical(){
"use strict";
var position, slideno, slidedif, tomove, curentleft, position;
jQuery('#googleMapSlider').hide();
position=parseInt(jQuery('#carousel-listing .carousel-inner .active').index(),10);
jQuery('#carousel-indicators-vertical li').removeClass('active');
jQuery('#carousel-listing .caption-wrapper span').removeClass('active');
jQuery("#carousel-listing .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
jQuery("#carousel-listing .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
jQuery("#carousel-indicators-vertical li[data-slide-to='"+position+"'] ").addClass('active');
slideno=position+1;
slidedif=slideno*84;
if(slidedif > 336){
tomove=336-slidedif;
tomove=tomove;
jQuery('#carousel-indicators-vertical').css('top',tomove+"px");
}else{
position=jQuery('#carousel-indicators-vertical').css('top',tomove+"px").position();
curentleft=position.top;
if(curentleft < 0){
tomove=0;
jQuery('#carousel-indicators-vertical').css('top',tomove+"px");
}}
}
function show_capture(){
"use strict";
var position, slideno, slidedif, tomove, curentleft, position;
jQuery('#googleMapSlider').hide();
position=parseInt(jQuery('#carousel-listing .carousel-inner .active').index(),10);
jQuery('#carousel-listing .caption-wrapper span').removeClass('active');
jQuery('#carousel-listing .carousel-round-indicators li').removeClass('active');
jQuery("#carousel-listing .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
jQuery("#carousel-listing .carousel-round-indicators li[data-slide-to='"+position+"'] ").addClass('active');
slideno=position+1;
slidedif=slideno*146;
if(slidedif > 810){
tomove=810-slidedif;
jQuery('.post-carusel .carousel-indicators').css('left',tomove+"px");
}else{
position=jQuery('.post-carusel .carousel-indicators').css('left',tomove+"px").position();
curentleft=position.left;
if(curentleft < 0){
tomove=0;
jQuery('.post-carusel .carousel-indicators').css('left',tomove+"px");
}}
}
function raisePower(x, y){
return Math.pow(x, y);
}
function shortcode_google_map_load(containermap, lat, long, mapid){
"use strict";
var myCenter=new google.maps.LatLng(lat, long);
var mapOptions={
flat:false,
noClear:false,
zoom: 15,
scrollwheel: false,
draggable: true,
center: myCenter,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl:false,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP]
},
disableDefaultUI: true
};
map=new google.maps.Map(document.getElementById(mapid), mapOptions);
google.maps.visualRefresh=true;
var marker=new google.maps.Marker({
position: myCenter,
map: map
});
marker.setMap(map);
}
function adv_search_click(){
jQuery('#adv-search-header-1').click(function(){
jQuery('#search_wrapper').toggleClass('fullscreen_search_open');
});
}
function contact_footer_starter(){
jQuery('#btn-cont-submit').click(function (){
var contact_name, contact_email, contact_phone, contact_coment, agent_email, property_id, nonce, ajaxurl;
contact_name=jQuery('#foot_contact_name').val();
contact_email=jQuery('#foot_contact_email').val();
contact_phone=jQuery('#foot_contact_phone').val();
contact_coment=jQuery('#foot_contact_content').val();
agent_email=jQuery('#foot_agent_email').val();
nonce=jQuery('#contact_footer_ajax_nonce').val();
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
jQuery.ajax({
type: 'POST',
dataType: 'json',
url: ajaxurl,
data: {
'action':'wpestate_ajax_contact_form_footer',
'name':contact_name,
'email':contact_email,
'phone':contact_phone,
'contact_coment':contact_coment,
'agentemail': agent_email,
'propid':property_id,
'nonce':nonce
},
success: function (data){
if(data.sent){
jQuery('#foot_contact_name').val('');
jQuery('#foot_contact_email').val('');
jQuery('#foot_contact_phone').val('');
jQuery('#foot_contact_content').val('');
}
jQuery('#footer_alert-agent-contact').empty().append(data.response);
},
error: function (errorThrown){
}});
});
}
function filter_invoices(){
"use strict";
var ajaxurl, start_date, end_date, type, status;
start_date=jQuery('#invoice_start_date').val();
end_date=jQuery('#invoice_end_date').val();
type=jQuery('#invoice_type').val();
status=jQuery('#invoice_status').val();
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
jQuery.ajax({
type: 'POST',
url: ajaxurl,
dataType: 'json',
data: {
'action':'wpestate_ajax_filter_invoices',
'start_date':start_date,
'end_date':end_date,
'type':type,
'status':status
},
success: function (data){
jQuery('#container-invoices').empty().append(data.results);
jQuery('#invoice_confirmed').empty().append(data.invoice_confirmed);
},
error: function (errorThrown){
}});
};
;
window.Modernizr=(function(window, document, undefined){
var version='2.6.2',
Modernizr={},
enableClasses=true,
docElement=document.documentElement,
mod='modernizr',
modElem=document.createElement(mod),
mStyle=modElem.style,
inputElem=document.createElement('input') ,
smile=':)',
toString={}.toString,
prefixes=' -webkit- -moz- -o- -ms- '.split(' '),
omPrefixes='Webkit Moz O ms',
cssomPrefixes=omPrefixes.split(' '),
domPrefixes=omPrefixes.toLowerCase().split(' '),
ns={'svg': 'http://www.w3.org/2000/svg'},
tests={},
inputs={},
attrs={},
classes=[],
slice=classes.slice,
featureName,
injectElementWithStyles=function(rule, callback, nodes, testnames){
var style, ret, node, docOverflow,
div=document.createElement('div'),
body=document.body,
fakeBody=body||document.createElement('body');
if(parseInt(nodes, 10)){
while(nodes--){
node=document.createElement('div');
node.id=testnames ? testnames[nodes]:mod + (nodes + 1);
div.appendChild(node);
}}
style=['',''].join('');
div.id=mod;
(body ? div:fakeBody).innerHTML +=style;
fakeBody.appendChild(div);
if(!body){
fakeBody.style.background='';
fakeBody.style.overflow='hidden';
docOverflow=docElement.style.overflow;
docElement.style.overflow='hidden';
docElement.appendChild(fakeBody);
}
ret=callback(div, rule);
if(!body){
fakeBody.parentNode.removeChild(fakeBody);
docElement.style.overflow=docOverflow;
}else{
div.parentNode.removeChild(div);
}
return !!ret;
},
testMediaQuery=function(mq){
var matchMedia=window.matchMedia||window.msMatchMedia;
if(matchMedia){
return matchMedia(mq).matches;
}
var bool;
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; }}', function(node){
bool=(window.getComputedStyle ?
getComputedStyle(node, null) :
node.currentStyle)['position']=='absolute';
});
return bool;
},
isEventSupported=(function(){
var TAGNAMES={
'select': 'input', 'change': 'input',
'submit': 'form', 'reset': 'form',
'error': 'img', 'load': 'img', 'abort': 'img'
};
function isEventSupported(eventName, element){
element=element||document.createElement(TAGNAMES[eventName]||'div');
eventName='on' + eventName;
var isSupported=eventName in element;
if(!isSupported){
if(!element.setAttribute){
element=document.createElement('div');
}
if(element.setAttribute&&element.removeAttribute){
element.setAttribute(eventName, '');
isSupported=is(element[eventName], 'function');
if(!is(element[eventName], 'undefined')){
element[eventName]=undefined;
}
element.removeAttribute(eventName);
}}
element=null;
return isSupported;
}
return isEventSupported;
})(),
_hasOwnProperty=({}).hasOwnProperty, hasOwnProp;
if(!is(_hasOwnProperty, 'undefined')&&!is(_hasOwnProperty.call, 'undefined')){
hasOwnProp=function (object, property){
return _hasOwnProperty.call(object, property);
};}else{
hasOwnProp=function (object, property){
return ((property in object)&&is(object.constructor.prototype[property], 'undefined'));
};}
if(!Function.prototype.bind){
Function.prototype.bind=function bind(that){
var target=this;
if(typeof target!="function"){
throw new TypeError();
}
var args=slice.call(arguments, 1),
bound=function (){
if(this instanceof bound){
var F=function(){};
F.prototype=target.prototype;
var self=new F();
var result=target.apply(self,
args.concat(slice.call(arguments))
);
if(Object(result)===result){
return result;
}
return self;
}else{
return target.apply(that,
args.concat(slice.call(arguments))
);
}};
return bound;
};}
function setCss(str){
mStyle.cssText=str;
}
function setCssAll(str1, str2){
return setCss(prefixes.join(str1 + ';') +(str2||''));
}
function is(obj, type){
return typeof obj===type;
}
function contains(str, substr){
return !!~('' + str).indexOf(substr);
}
function testProps(props, prefixed){
for(var i in props){
var prop=props[i];
if(!contains(prop, "-")&&mStyle[prop]!==undefined){
return prefixed=='pfx' ? prop:true;
}}
return false;
}
function testDOMProps(props, obj, elem){
for(var i in props){
var item=obj[props[i]];
if(item!==undefined){
if(elem===false) return props[i];
if(is(item, 'function')){
return item.bind(elem||obj);
}
return item;
}}
return false;
}
function testPropsAll(prop, prefixed, elem){
var ucProp=prop.charAt(0).toUpperCase() + prop.slice(1),
props=(prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
if(is(prefixed, "string")||is(prefixed, "undefined")){
return testProps(props, prefixed);
}else{
props=(prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
return testDOMProps(props, prefixed, elem);
}} tests['flexbox']=function(){
return testPropsAll('flexWrap');
}; tests['canvas']=function(){
var elem=document.createElement('canvas');
return !!(elem.getContext&&elem.getContext('2d'));
};
tests['canvastext']=function(){
return !!(Modernizr['canvas']&&is(document.createElement('canvas').getContext('2d').fillText, 'function'));
};
tests['webgl']=function(){
return !!window.WebGLRenderingContext;
};
tests['touch']=function(){
var bool;
if(('ontouchstart' in window)||window.DocumentTouch&&document instanceof DocumentTouch){
bool=true;
}else{
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function(node){
bool=node.offsetTop===9;
});
}
return bool;
};
tests['geolocation']=function(){
return 'geolocation' in navigator;
};
tests['postmessage']=function(){
return !!window.postMessage;
};
tests['websqldatabase']=function(){
return !!window.openDatabase;
};
tests['indexedDB']=function(){
return !!testPropsAll("indexedDB", window);
};
tests['hashchange']=function(){
return isEventSupported('hashchange', window)&&(document.documentMode===undefined||document.documentMode > 7);
};
tests['history']=function(){
return !!(window.history&&history.pushState);
};
tests['draganddrop']=function(){
var div=document.createElement('div');
return ('draggable' in div)||('ondragstart' in div&&'ondrop' in div);
};
tests['websockets']=function(){
return 'WebSocket' in window||'MozWebSocket' in window;
};
tests['rgba']=function(){
setCss('background-color:rgba(150,255,150,.5)');
return contains(mStyle.backgroundColor, 'rgba');
};
tests['hsla']=function(){
setCss('background-color:hsla(120,40%,100%,.5)');
return contains(mStyle.backgroundColor, 'rgba')||contains(mStyle.backgroundColor, 'hsla');
};
tests['multiplebgs']=function(){
setCss('background:url(https://),url(https://),red url(https://)');
return (/(url\s*\(.*?){3}/).test(mStyle.background);
}; tests['backgroundsize']=function(){
return testPropsAll('backgroundSize');
};
tests['borderimage']=function(){
return testPropsAll('borderImage');
};
tests['borderradius']=function(){
return testPropsAll('borderRadius');
};
tests['boxshadow']=function(){
return testPropsAll('boxShadow');
};
tests['textshadow']=function(){
return document.createElement('div').style.textShadow==='';
};
tests['opacity']=function(){
setCssAll('opacity:.55');
return (/^0.55$/).test(mStyle.opacity);
};
tests['cssanimations']=function(){
return testPropsAll('animationName');
};
tests['csscolumns']=function(){
return testPropsAll('columnCount');
};
tests['cssgradients']=function(){
var str1='background-image:',
str2='gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3='linear-gradient(left top,#9f9, white);';
setCss(
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
prefixes.join(str3 + str1)).slice(0, -str1.length)
);
return contains(mStyle.backgroundImage, 'gradient');
};
tests['cssreflections']=function(){
return testPropsAll('boxReflect');
};
tests['csstransforms']=function(){
return !!testPropsAll('transform');
};
tests['csstransforms3d']=function(){
var ret = !!testPropsAll('perspective');
if(ret&&'webkitPerspective' in docElement.style){
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function(node, rule){
ret=node.offsetLeft===9&&node.offsetHeight===3;
});
}
return ret;
};
tests['csstransitions']=function(){
return testPropsAll('transition');
};
tests['fontface']=function(){
var bool;
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function(node, rule){
var style=document.getElementById('smodernizr'),
sheet=style.sheet||style.styleSheet,
cssText=sheet ? (sheet.cssRules&&sheet.cssRules[0] ? sheet.cssRules[0].cssText:sheet.cssText||''):'';
bool=/src/i.test(cssText)&&cssText.indexOf(rule.split(' ')[0])===0;
});
return bool;
};
tests['generatedcontent']=function(){
var bool;
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function(node){
bool=node.offsetHeight >=3;
});
return bool;
};
tests['video']=function(){
var elem=document.createElement('video'),
bool=false;
try {
if(bool = !!elem.canPlayType){
bool=new Boolean(bool);
bool.ogg=elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
bool.h264=elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
bool.webm=elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
}} catch(e){ }
return bool;
};
tests['audio']=function(){
var elem=document.createElement('audio'),
bool=false;
try {
if(bool = !!elem.canPlayType){
bool=new Boolean(bool);
bool.ogg=elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
bool.mp3=elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
bool.wav=elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
bool.m4a=(elem.canPlayType('audio/x-m4a;') ||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
}} catch(e){ }
return bool;
};
tests['localstorage']=function(){
try {
localStorage.setItem(mod, mod);
localStorage.removeItem(mod);
return true;
} catch(e){
return false;
}};
tests['sessionstorage']=function(){
try {
sessionStorage.setItem(mod, mod);
sessionStorage.removeItem(mod);
return true;
} catch(e){
return false;
}};
tests['webworkers']=function(){
return !!window.Worker;
};
tests['applicationcache']=function(){
return !!window.applicationCache;
};
tests['svg']=function(){
return !!document.createElementNS&&!!document.createElementNS(ns.svg, 'svg').createSVGRect;
};
tests['inlinesvg']=function(){
var div=document.createElement('div');
div.innerHTML='
';
return (div.firstChild&&div.firstChild.namespaceURI)==ns.svg;
};
tests['smil']=function(){
return !!document.createElementNS&&/SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
};
tests['svgclippaths']=function(){
return !!document.createElementNS&&/SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
};
function webforms(){
Modernizr['input']=(function(props){
for(var i=0, len=props.length; i < len; i++){
attrs[ props[i] ] = !!(props[i] in inputElem);
}
if(attrs.list){
attrs.list = !!(document.createElement('datalist')&&window.HTMLDataListElement);
}
return attrs;
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
Modernizr['inputtypes']=(function(props){
for(var i=0, bool, inputElemType, defaultView, len=props.length; i < len; i++){
inputElem.setAttribute('type', inputElemType=props[i]);
bool=inputElem.type!=='text';
if(bool){
inputElem.value=smile;
inputElem.style.cssText='position:absolute;visibility:hidden;';
if(/^range$/.test(inputElemType)&&inputElem.style.WebkitAppearance!==undefined){
docElement.appendChild(inputElem);
defaultView=document.defaultView;
bool=defaultView.getComputedStyle &&
defaultView.getComputedStyle(inputElem, null).WebkitAppearance!=='textfield' &&
(inputElem.offsetHeight!==0);
docElement.removeChild(inputElem);
}else if(/^(search|tel)$/.test(inputElemType)){
}else if(/^(url|email)$/.test(inputElemType)){
bool=inputElem.checkValidity&&inputElem.checkValidity()===false;
}else{
bool=inputElem.value!=smile;
}}
inputs[ props[i] ] = !!bool;
}
return inputs;
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
}
for(var feature in tests){
if(hasOwnProp(tests, feature)){
featureName=feature.toLowerCase();
Modernizr[featureName]=tests[feature]();
classes.push((Modernizr[featureName] ? '':'no-') + featureName);
}}
Modernizr.input||webforms();
Modernizr.addTest=function(feature, test){
if(typeof feature=='object'){
for(var key in feature){
if(hasOwnProp(feature, key)){
Modernizr.addTest(key, feature[ key ]);
}}
}else{
feature=feature.toLowerCase();
if(Modernizr[feature]!==undefined){
return Modernizr;
}
test=typeof test=='function' ? test():test;
if(typeof enableClasses!=="undefined"&&enableClasses){
docElement.className +=' ' + (test ? '':'no-') + feature;
}
Modernizr[feature]=test;
}
return Modernizr;
};
setCss('');
modElem=inputElem=null;
;(function(window, document){
var options=window.html5||{};
var reSkip=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
var saveClones=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
var supportsHtml5Styles;
var expando='_html5shiv';
var expanID=0;
var expandoData={};
var supportsUnknownElements;
(function(){
try {
var a=document.createElement('a');
a.innerHTML='
';
supportsHtml5Styles=('hidden' in a);
supportsUnknownElements=a.childNodes.length==1||(function(){
(document.createElement)('a');
var frag=document.createDocumentFragment();
return (
typeof frag.cloneNode=='undefined' ||
typeof frag.createDocumentFragment=='undefined' ||
typeof frag.createElement=='undefined'
);
}());
} catch(e){
supportsHtml5Styles=true;
supportsUnknownElements=true;
}}()); function addStyleSheet(ownerDocument, cssText){
var p=ownerDocument.createElement('p'),
parent=ownerDocument.getElementsByTagName('head')[0]||ownerDocument.documentElement;
p.innerHTML='x';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
function getElements(){
var elements=html5.elements;
return typeof elements=='string' ? elements.split(' '):elements;
}
function getExpandoData(ownerDocument){
var data=expandoData[ownerDocument[expando]];
if(!data){
data={};
expanID++;
ownerDocument[expando]=expanID;
expandoData[expanID]=data;
}
return data;
}
function createElement(nodeName, ownerDocument, data){
if(!ownerDocument){
ownerDocument=document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if(!data){
data=getExpandoData(ownerDocument);
}
var node;
if(data.cache[nodeName]){
node=data.cache[nodeName].cloneNode();
}else if(saveClones.test(nodeName)){
node=(data.cache[nodeName]=data.createElem(nodeName)).cloneNode();
}else{
node=data.createElem(nodeName);
}
return node.canHaveChildren&&!reSkip.test(nodeName) ? data.frag.appendChild(node):node;
}
function createDocumentFragment(ownerDocument, data){
if(!ownerDocument){
ownerDocument=document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data=data||getExpandoData(ownerDocument);
var clone=data.frag.cloneNode(),
i=0,
elems=getElements(),
l=elems.length;
for(;i